This has only been tested on Wamp. It's the method I use as its quick and easy, you can use tools such as bigdump but I prefer this on a localhost install as you have easy access already.
Download your database from your live site. Extract the .gz so you have just a .sql file.
For this example (remember yours will be different) , you need the following...
The root users name and password (for mysql) , its normally just "root" and no password.
The name of the new blank database (if you have not already created one, visit your localhost phpmyadmin and create a new blank database now)
Use windows explorer or a command prompt. Navigate your way to the folder where wamp is installed. You need to go into the folder where mysql.exe is. In my case it is D:\_DEV_SERVER\bin\mysql\mysql5.1.30\bin . Most cases it will be c:\program files\wamp\bin\mysql\mysql version\bin etc...
Copy the .sql file into here. It must be in the same directory as mysql.exe
Open a command prompt in this directory if you have not already. If you have command prompt here powertoy, this can be quicker than having to navigate via a command prompt to here.
For this example, the database I am importing is called mybackup.sql and the new empty database I created is called test
Assuming you do NOT have a root password, type in the following...
mysql.exe -u root test < mybackup.sql
This may take a few minutes depending on the database size and your CPU power, your firewall may prompt you so you will have to allow temporary access (should only be mysql wanting localhost access)
When its finished, remove the mybackup.sql file you put in that directory.
Done
As an extra note, if you have a root password for mysql, you will need to use this instead (changing pass for the password)
mysql.exe -u root -p pass test < mybackup.sql Wyświetl pełny artykuł