Moving DB

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
soundbwoy
Forum Newbie
Posts: 21
Joined: Sat Jun 07, 2003 5:22 pm
Location: Orlando, FL

Moving DB

Post 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?
User avatar
delorian
Forum Contributor
Posts: 223
Joined: Sun May 04, 2003 5:20 pm
Location: Olsztyn, Poland

Re: Moving DB

Post 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.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
User avatar
soundbwoy
Forum Newbie
Posts: 21
Joined: Sat Jun 07, 2003 5:22 pm
Location: Orlando, FL

Post 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?
SBukoski
Forum Contributor
Posts: 128
Joined: Wed May 21, 2003 10:39 pm
Location: Worcester, MA

Post 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.
User avatar
soundbwoy
Forum Newbie
Posts: 21
Joined: Sat Jun 07, 2003 5:22 pm
Location: Orlando, FL

Post 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?
Post Reply