nuttycoder Posted January 12, 2008 Share Posted January 12, 2008 Hi, I need to import my database to a server that I don't have access to phpmyadmin so was wondering is there a way to import a MySQL database using PHP? Quote Link to comment https://forums.phpfreaks.com/topic/85733-importing-database/ Share on other sites More sharing options...
phpknight Posted January 13, 2008 Share Posted January 13, 2008 If the file is plain text, you could take all the comments out and then read one query at time a time, and then run it. You really should have access to phpmyadmin, though. I would move if my server did not have it. Quote Link to comment https://forums.phpfreaks.com/topic/85733-importing-database/#findComment-437646 Share on other sites More sharing options...
nuttycoder Posted January 13, 2008 Author Share Posted January 13, 2008 its an sql file, It for a server I don't own (uni server) so there's restrictions in place to what I can and can't have acess to. Quote Link to comment https://forums.phpfreaks.com/topic/85733-importing-database/#findComment-437688 Share on other sites More sharing options...
phpknight Posted January 13, 2008 Share Posted January 13, 2008 Well, the sql files I use I just plain text if you open them, so it should not be so bad. Just read line by line to the semi-colon and execute the statements. I'd make a copy of the database before you do to make sure it looks right. Quote Link to comment https://forums.phpfreaks.com/topic/85733-importing-database/#findComment-437708 Share on other sites More sharing options...
nuttycoder Posted January 13, 2008 Author Share Posted January 13, 2008 Thats what I've been doing but its tedious as I've got over 200 rows for one of the tables would have been better if I could have imported the database. Thanks for your help. Quote Link to comment https://forums.phpfreaks.com/topic/85733-importing-database/#findComment-437728 Share on other sites More sharing options...
phpknight Posted January 13, 2008 Share Posted January 13, 2008 You could also just code it in to ignore comments. Quote Link to comment https://forums.phpfreaks.com/topic/85733-importing-database/#findComment-437746 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.