If you're trying to import a large database into your local database, there's really a simple solution.
On Windows, if you're running WAMP Server, click on the WAMPSERVER icon in your task-bar. Under the MySQL folder, select my.ini. In the text file, you'll see a myisam_sort_buffer_size. Change it to something large (i.e. 1000M). Save the file and restart all services (click the WAMPSERVER icon and click Restart All Services).
Next, open CMD. Navigate to your mysql folder in the wamp directory. For me it was:
C:\wamp\bin\mysql\mysql.5.17\bin
In the bin folder, there will be a utility called mysql that we'll use in a second.
To simplify the next step, once you've exported the .sql database, move the file from your Downloads Folder to the same bin folder specified above (note that your path may be different than mine).
Once the file is in the folder, i.e. test.sql, make sure that on your local server you have a database created with the same name as the one you exported. In this example the database name will be TestDB.
Since you probably didn't delete the root user from your local install, just use root as the username in the next step.
In CMD, type in:
C:\wamp\bin\mysql\mysql.5.17\bin>mysql -u root -p TestDB < test.sql
After you hit enter, it'll prompt you to enter a password. Since your root password is most likely blank, hit Enter. Once the process finishes the import, you'll be able to type something else into CMD. At that point, check your database via phpMyAdmin and you'll notice that everything has been imported.
On Windows, if you're running WAMP Server, click on the WAMPSERVER icon in your task-bar. Under the MySQL folder, select my.ini. In the text file, you'll see a myisam_sort_buffer_size. Change it to something large (i.e. 1000M). Save the file and restart all services (click the WAMPSERVER icon and click Restart All Services).
Next, open CMD. Navigate to your mysql folder in the wamp directory. For me it was:
C:\wamp\bin\mysql\mysql.5.17\bin
In the bin folder, there will be a utility called mysql that we'll use in a second.
To simplify the next step, once you've exported the .sql database, move the file from your Downloads Folder to the same bin folder specified above (note that your path may be different than mine).
Once the file is in the folder, i.e. test.sql, make sure that on your local server you have a database created with the same name as the one you exported. In this example the database name will be TestDB.
Since you probably didn't delete the root user from your local install, just use root as the username in the next step.
In CMD, type in:
C:\wamp\bin\mysql\mysql.5.17\bin>mysql -u root -p TestDB < test.sql
After you hit enter, it'll prompt you to enter a password. Since your root password is most likely blank, hit Enter. Once the process finishes the import, you'll be able to type something else into CMD. At that point, check your database via phpMyAdmin and you'll notice that everything has been imported.
Comments
Post a Comment