Home » Archive

Articles in the MySQL Category

MySQL, Solved Issues »

[17 Jun 2010 | No Comment | ]

Follow the below code to import mysql database using command line.

mysql -uUSERNAME -pDATABASE < DATABASE_FILE.SQL

Format: mysql -uroot -ppasword -hlocalhost database-name < sql_dump_file_name.sql

Correct Example: mysql -uroot -palakmalak -hlocalhost oca < cerb4oca.sql
Note: Do not go to mysql console. Just go to the directory where your backup file resides.
Note: Do not use -u space username like -u root ( this will not work ) use -uroot -ppassword -hlocalhost

Wrong Example: mysql -u root -p abc123 localhost < mytest.sql

where root is USERNAME of MySQL, abc123 is DATABASE of MyQL and mytest.sql is …