mysql: backup databases

Posted Leave a commentPosted in MySQL

Backups all databases mysqldump -u [user] -p[password] --all-databases > [filename].sql   specific databases mysqldump -u [user] -p[password] [database_name] > [filename].sql   specific database but omitting specific tables mysqldump -u [user] -p[password] [database_name] --ignore-table=db1.tbl1 --ignore-table=db2.tbl1 > [filename].sql   restore mysql -u […]

mysql: enable logging

Posted Leave a commentPosted in MySQL

mysql> show variables like '%log%'; Recreate the log files I deleted by mistake. It appears the MySQL does not recreate them automatically. touch /var/log/mysql.log chown mysql:adm /var/log/mysql.log touch /var/log/mysql/error.log chown mysql:adm /var/log/mysql/error.log touch /var/log/mysql/mysql-slow.log chown mysql:adm /var/log/mysql/mysql-slow.log touch /var/log/mysql/mysql.log chown […]