How to import and dump (backup) MYSQL database?

Login to your server as root

Restore data from your .sql backup file to the corresponding database:

[root@server ~]# mysql -u username -p -h localhost database_name < database_back.sql

Replace username with database username and the database_name with actual database name in which you want to store data which is present in the database_back.sql file.

If you are having dedicated server you can replace localhost with your server IP.

[root@server ~]# mysql -u username -p -h 92.48.76.90 database_name < database_back.sql

If you are logged into your server as a root user then you can just use following command directly.

[root@server ~]# mysql database_name < database_back.sql

================================================== ========

Always recommended to take backup for a database first, which already exists and in which you want to import the backup.

If you want to take a complete backup for your database in a .sql file, you can run following command on the server.

[root@server ~]# mysqldump database_name > database_backup.sql

Run following command if you want to take backup for a particulate table in a database.

[root@server ~]# mysqldump database table-name > table_backup.sql

Replace database with actual database name and table-name with the table name for which you want to take a backup.

  • 1 Utilizadores acharam útil
Esta resposta foi útil?

Artigos Relacionados

Can I use my domain name or must I use my IP address as the hostname for FTP?

Using your IP address (192.168.22.22  is an example IP address) is the preferred entry for...

Can you transfer my sites from my current host to my new VPS?

Yes. We will transfer all of your sites free* of charge and will assure that you experience no or...

Do you allow MP3 files? Do you allow streaming of videos?

Yes we do with our special plans at http://hostripples.in/avs-hosting.php

Do you support Cold Fusion?

We do not support or Cold Fusion on our shared hosting servers, however you are more than welcome...