Restoring a Backup (Import A MySQL Database)

http://www.linuxtweaker.com/linux/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

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s