Hello readers, we are back again with a new solution to you.. Many of you must have used wampserver for creating php website projects and database connections. But here's a problem. if we want to import our project from some other system, you can copy the project files but how to create the same database again. Its quite time consuming and of your database is too large, then its nearly impossible to enter it all again manually. and copy-paste method usually doesn't work as it makes MYSQL CONSOLE unresponsive. So you need not to edit it all.
We are giving you a method to import your large database siles through command prompt only.
So here is how you go..
1. first, copy the database file ( .sql ) to this path: "C:\wamp\bin\mysql\mysql5.1.36\bin "
3. If you opened the command prompt, type there
" CD C:\wamp\bin\mysql\mysql5.1.36\bin "
4. Now prepare for the command, you will need the datebase name ( you must created it before ), and the database username ( default for wamp is root ) and database password ( default for wamp is nothing, no password is set )
Type the following command::
mysql -u [DATABASE_USERNAME] -p [DATABASE_NAME] < [DATABASE_FILE.SQL]
After that hit enter.. it will ask you the password, if it's empty just hit enter again or type it then enter.. then it will restore the db.. for a db with a large size it will take seconds only.
So try it and enjoy computing.. :)
We are giving you a method to import your large database siles through command prompt only.
So here is how you go..
1. first, copy the database file ( .sql ) to this path: "C:\wamp\bin\mysql\mysql5.1.36\bin "
- The number after mysql maychange depending on which version of wamp/mysql do you have.. but in normal cases, it will be only one folder there in mysql folder. so enter it and then go to 'bin' folder and copy the .sql there..
- also be careful that your database file is saved as a .sql file only.
3. If you opened the command prompt, type there
" CD C:\wamp\bin\mysql\mysql5.1.36\bin "
- Note the space after CD in the begining, then hit enter
4. Now prepare for the command, you will need the datebase name ( you must created it before ), and the database username ( default for wamp is root ) and database password ( default for wamp is nothing, no password is set )
Type the following command::
mysql -u [DATABASE_USERNAME] -p [DATABASE_NAME] < [DATABASE_FILE.SQL]
- Replace the brackets with the correct values, for example if your database name is PROPERTY and the sql file is property.sql and you use the default username and password for the database then the line will be
After that hit enter.. it will ask you the password, if it's empty just hit enter again or type it then enter.. then it will restore the db.. for a db with a large size it will take seconds only.
So try it and enjoy computing.. :)