Importing .sql file to a database through command prompt:
mysql -u root -p
It will prompt you to enter mysql_Password
Enter password:give_your_mysql_password_here
use database_name_to_which_.sqlfile_should_import;
SOURCE /path/to/sql_file
(or)
mysql -u root -p database_name_to_which_.sqlfile_should_import < example.sql;
Example:
use sample;
SOURCE /home/desktop/sample.sql;
Exporting Database to a .sql file through command prompt:
mysqldump -u root -p database_name_to_export > example.sql;
It will prompt you to enter mysql_Password
Enter password:give_your_mysql_password_here
Comments
Post a Comment