Question:
Please can anyone tell me, How to import mysql database through command prompt
Note:
I am beginner in mysql database
For Import Database in Phpmyadmin using cmd with process
C:>cd xampp
C:\xampp>cd mysql
C:\xampp\mysql>cd bin
Go to directory where you have mysql. -u - for username -p - to prompt the password
mysql -u username -ppassword databasename < file.sql
Note:It is better to use full path of the the sql file file.sql
To import database from dump file (in this case called filename.sql) use: mysql -u username -p password database_name < filename.sql
If you are on Windows you will need to open CMD and go to directory where mysql.exe is installed. If you are using WAMP server then this is usually located in: C:\wamp\bin\mysql\mysql5.1.36\bin (*note the version of mysql might be different)
So you will: cd C:\wamp\bin\mysql\mysql5.1.36\bin
and then execute one of the above commands.
Try This
mysql -u username -p[******] database_name < mysqlfile.sql
For more details for export and import database please click here.
mysql -u username -p database_name < dump.sql
You will then be prompted for the database password. Enter it and that's it. :)