barrow Posted June 21, 2003 Share Posted June 21, 2003 I have a database on one server and need to move it to another. Is there a way to export the database to a .sql file so I can just run it on my new server and poof my database it there? Quote Link to comment https://forums.phpfreaks.com/topic/621-exporting-a-database/ Share on other sites More sharing options...
Arenium Posted June 21, 2003 Share Posted June 21, 2003 are you using phpmyadmin? if you are i can give you detailed instructions (yeah, all 4 mouse clicks ) but i wont bother unless you do. Quote Link to comment https://forums.phpfreaks.com/topic/621-exporting-a-database/#findComment-2066 Share on other sites More sharing options...
barrow Posted June 21, 2003 Author Share Posted June 21, 2003 Nope, on the server with the database I only have webmin which I don\'t like too much so I telnet in. Quote Link to comment https://forums.phpfreaks.com/topic/621-exporting-a-database/#findComment-2067 Share on other sites More sharing options...
BinaryStar Posted June 21, 2003 Share Posted June 21, 2003 You can write a script, have it extract the database name, all table names, all columns per table and the data and have it write your own SQL file.... not too hard.... check this out... http://www.php.net/manual/en/ref.mysql.php BS Quote Link to comment https://forums.phpfreaks.com/topic/621-exporting-a-database/#findComment-2068 Share on other sites More sharing options...
barrow Posted June 21, 2003 Author Share Posted June 21, 2003 Well, i\'m a newb and was hoping there was already a function written that did this something like . Export(directorypath, filename.sql) oh well. Quote Link to comment https://forums.phpfreaks.com/topic/621-exporting-a-database/#findComment-2069 Share on other sites More sharing options...
Arenium Posted June 21, 2003 Share Posted June 21, 2003 hmm...on my linux partition i have a phpmyadmin install...i might get around to looking at the php file/function used to make the sql file. No promises though Quote Link to comment https://forums.phpfreaks.com/topic/621-exporting-a-database/#findComment-2070 Share on other sites More sharing options...
BinaryStar Posted June 21, 2003 Share Posted June 21, 2003 Only one way to not be a newbie anymore, just expirement, read that URL i gave you, it is only like 4 to 5 major functions and your done.... mysql_list_dbs() - List databases available on a MySQL server mysql_list_fields() - List MySQL result fields mysql_list_tables() - List tables in a MySQL database It is really quite easy... BS Quote Link to comment https://forums.phpfreaks.com/topic/621-exporting-a-database/#findComment-2076 Share on other sites More sharing options...
rhysmeister Posted June 27, 2003 Share Posted June 27, 2003 There is such a function, use mysqldump... http://www.mysql.com/doc/en/mysqldump.html Quote Link to comment https://forums.phpfreaks.com/topic/621-exporting-a-database/#findComment-2150 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.