Jump to content

Backup database by MySQL


Recommended Posts

I have a forum with 50M database, and i have just change my server hosting.

But i don't want to restore database from PHP MyAdmin because it's very slow...

So, i try find another way. But i have some problem with that.

I test on localhost, and it work very well. But i can't do that with my host...

I use MySQL to restore database by run C:\mysql\bin\mysql.exe

and type: connect dbname localhost

then type: source dbrestore.sql to run.

But i can't do with my host...

Anyone help me...?

If another better way please tell me !

Link to comment
Share on other sites


Quite often the access to a MySQL database is restricted, so you can test on localhost but can not access a remote host. In these cases phpMyAdmin is often the only choice, however as you say it can be slow on dumping quite large databases.

If you hav SSH access to your new host go there and once you have access

mysqldump -hxxxx.xxx.xx.xx -uxxxxx -pxxxxx databasename >dump.sql

The xxxxx are required host, username and password obtainable from your hosting provider, replace these with yours, the databasename obviously is your database name the >dump.sql is a redirect pipe to a file called dump.sql

In short this dumps out your database (in a few seconds) you can then download this dump.sql file by ftp.

To get access use the putty client, you can download it here

http://www.chiark.greenend.org.uk/~sgtatha...y/download.html

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...