Backup MySQL Database in Linux 23.02.12

  • Ubuntu Server
  • Comments Off on Backup MySQL Database in Linux
  • 0
  • mysqldump –opt -u [uname] -p[pass] [dbname] > [backupfile.sql]

    [uname] Your database username
    [pass] The password for your database (note there is no space between -p and the password)
    [dbname] The name of your database
    [backupfile.sql] The filename for your database backup
    [–opt] The mysqldump option

    To backup a database named ‘Tutorials’ with the username ‘root’ and with no password to a file tut_backup.sql, you should accomplish this command :

    mysqldump -u root -p Tutorials > tut_backup.sql

    Specify certain tables of your database you want to backup :

    mysqldump -u root -p Tutorials php_tutorials asp_tutorials > tut_backup.sql

    To back up more that one database at once :

    mysqldump -u root -p –databases Tutorials Articles Comments > content_backup.sql

    To back up all databases at one time :

    mysqldump -u root -p –all-databases > alldb_backup.sql

    Related Articles

    Comments are closed.