Page 1 of 1

Moving DB

Posted: Sun Jun 08, 2003 2:53 pm
by soundbwoy
I am moving my database from my development machine to my server. What is the easyiest way to do this. Can I create a .sql script to build it for me?

Re: Moving DB

Posted: Sun Jun 08, 2003 3:28 pm
by delorian
soundbwoy wrote:I am moving my database from my development machine to my server. What is the easyiest way to do this. Can I create a .sql script to build it for me?
You should crate a .sql script. It's the easiest way. Of coures, if there is no data in that database.

Posted: Sun Jun 08, 2003 3:44 pm
by twigletmac
phpMyAdmin can making exporting and importing databases a fairly simple operation (assuming of course that you're using MySQL which of course you may not be so sorry if you aren't):
http://www.phpmyadmin.net

Mac

Posted: Sun Jun 08, 2003 7:37 pm
by soundbwoy
Yes I am using MySQL on both machines, And I have root access also. I guess I can do a backup database on the PHPMyadmin running locally and it will generate a .sql file that is my database, then I just move that script onto the server and run it in MySQL Prompt?

Posted: Sun Jun 08, 2003 10:54 pm
by SBukoski
phpMyAdmin will output a text file that is essentially a bunch of SQL commands that will drop and recreate your tables (depending on your options). Then you can use phpMyAdmin on the other side to read the file and run the SQL commands. It all works very nicely, and I use it all the time to take "snapshots" of my web server to import locally for testing.

I do believe the outputted file is in a proper format where you can also run it via a MySQL command prompt, if that is the way you prefer to go.

Posted: Tue Jun 10, 2003 3:12 am
by soundbwoy
Thanks I was able to execute it in the MySQL Command, I also found out where to do it in PHPMyAdmin. Had some trouble at first because I was forgetting to USE my DATABASE before running the script from the command prompt. It expects you to create the DB and USE it first I guess?