sukria / Backup-Manager

Versatile yet easy to use command line backup tool for GNU/Linux. Suitable for desktop and servers.
http://www.backup-manager.org/
GNU General Public License v2.0
279 stars 90 forks source link

enable to save mysql #86

Closed mrglobule closed 7 years ago

mrglobule commented 8 years ago

Hello, i try to run backup-manager - v on debian, but i have this message:

Using method "mysql".
Using existing MySQL client configuration file: /root/.backup-manager_my.cnf
Unable to exec first piped command /usr/bin/nice -n 10 /usr/bin/mysqldump --defaults-extra-file=/root/.backup-manager_my.cnf --opt -ubackup -hlocalhost -P3306  information_schema; check /tmp/bm-command.ncLCYp
Unable to find /var/archives/mail2-mysql-information_schema.20161128.sql.bz2
Releasing lock

Would you mind to help me?

Sorry for my poor english.

kissifrot commented 8 years ago

What do you have in the /tmp/bm-command.ncLCYp file?

mrglobule commented 8 years ago

Hi kissifrot, thanks for the answer, the file is: mysqldump: Got error: 1044: Access denied for user 'backup'@'localhost' to database 'information_schema' when using LOCK TABLES It's a problem of right, i check that. Thanks a lot.

I don't understand because user has the privileges:

+-----------+--------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+-----------------------+
| Host      | User   | Password                                  | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv | Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_slave_priv | Repl_client_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Create_user_priv | Event_priv | Trigger_priv | Create_tablespace_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions | max_updates | max_connections | max_user_connections | plugin                | authentication_string |
+-----------+--------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+-----------------------+
| localhost | backup | *FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF | Y           | N           | N           | N           | N           | N         | N           | N             | N            | Y         | N          | N               | Y          | N          | Y            | N          | Y                     | Y                | Y            | Y               | Y                | Y                | Y              | N                   | N                  | N                | Y          | N            | N                      |          |            |             |              |             0 |           0 |               0 |                    0 | mysql_native_password |                       |
+-----------+--------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+-----------------------+
1 row in set (0.00 sec)
kissifrot commented 7 years ago

By default, only root user has access to information_schema, make sure your backup user can lock information_schema's tables

mrglobule commented 7 years ago

Thanks kissifrot, i try to run backup-manager -v with the root user in the config file, but i have the same error ?!? mysqldump: Got error: 1044: Access denied for user 'root'@'localhost' to database 'information_schema' when using LOCK TABLES

kissifrot commented 7 years ago

Which version of MySQL are you using?

mrglobule commented 7 years ago

mysql Ver 14.14 Distrib 5.5.53, for debian-linux-gnu (x86_64) using readline 6.3

kissifrot commented 7 years ago

With MySQL you can't backup information_schema with other databases at the same time

mrglobule commented 7 years ago

thanks a lot, so i cannot put: export BM_MYSQL_DATABASES="__ALL__" in the bakup-manager.conf, i had to list the database and it's ok. Thanks a lot

kissifrot commented 7 years ago

You can also use the BM_MYSQL_SAFEDUMPS option and set it to false, but at a higher risk of missing data