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? 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. 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. 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. 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. 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. Link to comment https://forums.phpfreaks.com/topic/85733-importing-database/#findComment-437746 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.