Accueil > Bases de données > mysqldump: Copy Database Using Shell Pipes

mysqldump: Copy Database Using Shell Pipes

20/08/2023 Categories: Bases de données Tags: ,
Print Friendly, PDF & Email

Source: nixCraft

How do I use mysqldump command with Unix shell pipes?

The mysqldump client is a backup program which is used to dump a database or a collection of databases for backup or transfer to another SQL server (not necessarily a MySQL server). The dump typically contains SQL statements to create the table, populate it, or both. However, mysqldump can also be used to generate files in CSV, other delimited text, or XML format. The syntax is as follows to dump a database called foo to the remote server called

mysqldump db-name | mysql -h db-name
mysqldump foo | mysql -h foo

However, I recommend using VPN or ssh client to secure data transfer using the shell pipes as follows:

mysqldump db-name | ssh mysql db-name
mysqldump -u vivek -p'myPassWord' foo | ssh mysql -u backup -p'myPassword' bar


Lire aussi:  Check The Number Of MySQL Open Database Connections on Linux Or Unix-like Server
Categories: Bases de données Tags: ,
Les commentaires sont fermés.