Oracle/MSSQL/MySQL

Restoring a Backup (Import A MySQL Database)

How to export and import MySQL database via command line in Linux

root@Plxxxo:~#
root@Plxxrx:~# mysql -u root -p -h localhost cxxp_cxxtao < /var/www/pplxxx.ixxx/mysqlnewdump.sql
or
#mysql -u database_user_name -p my_db < /home/kudda/my_db_backup.sql

More info: Here it should be almost the same as the export.

#mysql -u database_user_name -p my_db < /home/kudda/my_db_backup.sql
Here it is the same as export. after u- you put your database user name
and the -p is used for the pasword option still. Here is one example of it.

Example: mysql -u root -p my_db < /home/kudda/my_db_backup.sql

On the example above, I am importing my_db_backup.sql script into the database my_db

 

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x