Welcome to Centmin Mod Community
Register Now

MariaDB How to backup real database files

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by YuchiRO, Apr 1, 2016.

  1. YuchiRO

    YuchiRO Member

    92
    6
    8
    Jan 12, 2015
    Ratings:
    +8
    Local Time:
    12:02 AM
    5.5.4
    Hi

    I had problem with mysql, i cant start mysql because i run wrong chmod for all server ...
    The best solution for me is re-install :). Ya, look like a stupid noob.

    I backup all files, but how to backup real database files without start mysql ?

    Thanks
     
  2. YuchiRO

    YuchiRO Member

    92
    6
    8
    Jan 12, 2015
    Ratings:
    +8
    Local Time:
    12:02 AM
    5.5.4
    I think i should copy folder in /var/lib/mysql and re-import again when install completed.
     
  3. eva2000

    eva2000 Administrator Staff Member

    28,976
    6,579
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,765
    Local Time:
    3:02 AM
    Nginx 1.13.x
    MariaDB 5.5
    For mysql backup and restore best to use mysqldump and mysql client commands respectively. And read MySQL :: MySQL 5.6 Reference Manual :: 7 Backup and Recovery For general management see Getting Started Guide step 11.

    Generally, the way is to use SSH commands below:

    backup
    Code:
    mysqldump -u mysqlusername -p mysqldatabasename > /path/to/mysqldatabasename_backup_date.sql
    restore
    Code:
    mysql -u mysqlusername -p mysqldatabasename < /path/to/mysqldatabasename_backup_date.sql
    If backup and/or restore commands work, then will return to command prompt without any message. To verify database is intact with all data, you need to inspect the database itself via phpmyadmin etc and/or use the database and compare to the original (inspect via phpmyadmin etc).