Jump to content

Archived

This topic is now archived and is closed to further replies.

Woodburn2006

testing server

Recommended Posts

when i build sites i use the testing apache server i have on my machine and then upload once i have completed the project.

is there any way of replicating my mysql database from my machine to the server without having to re-build the mysql database on the server?

Share this post


Link to post
Share on other sites
If you use the phpMyAdmin on both your local test machine and your production server, you will find that there is several exporting options for you to choose from. phpMyAdmin also offers an online documentation.

Share this post


Link to post
Share on other sites
Why don't you just connect remotely?

Share this post


Link to post
Share on other sites
ok will have a look, if i connect remotely then it is harder to make changes to a working site. i will have to keep uploading everytime i make a slight change in code and if i am doing a tricky bit i always do a bit at a time and test, it will take to long if i have to upload it all of the time

Share this post


Link to post
Share on other sites
I don't know what you mean by "upload it all"... I'm talking about a remote DB connection.

Share this post


Link to post
Share on other sites
ah right sorry i thought you were talking about the site itself. i sometimes do the work on my laptop, therefore i cant always have access to the DB as im not near an internet connection

Share this post


Link to post
Share on other sites
Well, if you don't really care about how "up-to-date" it is, you can always since have a daily dump, and pull it down via whatever, blow away your local copy, and start fresh.

Share this post


Link to post
Share on other sites
It looks like he just wants to be able to copy the local db to the remote db once. By "without having to re-build", I think he means without having to recreate all the tables by hand and enter all the information as he did on his local server.

If that's the case then using PhpMyadmin's export option as mentioned earlier in the thread should be what you're looking for. I'm not very familiar with PhpMyadmin, but it should be a straight forward process.

Instead of using Phpmyadmin, you can do it by hand using "mysqldump" and "mysql" to do the copy.

Backup on test server
[code]
mysqldump --opt dbname > file.sql
[/code]

Restore on production server
[code]
mysql dbname < file.sql

//or as a query
SOURCE /path/to/file.sql
[/code]

You can compress the sql file to make it much smaller and upload the compressed file. There should also be a similar option in Phpmyadmin.

In linux
[code]
mysqldump --opt dbname | gzip -c > file.sql.gz
[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.