En nuestro script de copias de seguridad de Mysql estamos recibiendo los siguientes errores.

 

Exportamos la BD
mysqldump: Got error: 1044: Access denied for user ‘root’@’localhost’ to database ‘information_schema’ when using LOCK TABLES

 

Buscando por google errores de este tipo encontre desde un parche hasta la modificacion de los permisos sobre la tabla information_schema

mysql> use information_schema;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show grants
-> ;
+—————————————————————————————————————————————————————————————————————————+
| Grants for root@localhost                                                                                                                                                                                                 |
+—————————————————————————————————————————————————————————————————————————+
| GRANT ALL PRIVILEGES ON *.* TO ‘root’@’localhost’ IDENTIFIED BY PASSWORD ‘*1xxxxxxxxxxxxxxxxxxxxxxxxxxxE’ WITH GRANT OPTION                                                                                    |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `OneOrZero`.* TO ‘root’@’localhost’ |
+—————————————————————————————————————————————————————————————————————————+
2 rows in set (0.00 sec)

Intento borrar los permisos de la tabla
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

Ahora la asignos permisos

 

mysql> grant all on *.* to root@’localhost’ identified by ‘password’;
Query OK, 0 rows affected (0.00 sec)

Pero sigue fallando, verifico la version para comprobar si el parche que hay en mysql es efectivo, pero con esta version no tengo necesidad de ese parche.

root@KUBUN:/etc# mysql –version
mysql  Ver 14.14 Distrib 5.1.41, for debian-linux-gnu (i486) using readline 6.1

 

Finalmente la solucion fue añadir segun esta en la documentacion de mysql el comando –skip-lock-tables

 

mysqldump does not dump the INFORMATION_SCHEMA database by default. As of MySQL 5.1.38, mysqldump dumps INFORMATION_SCHEMA if you name it explicitly on the command line, although currently you must also use the –skip-lock-tables option. Before 5.1.38, mysqldump silently ignores INFORMATION_SCHEMA even if you name it explicitly on the command line.

 

Ejemplo:

 

$MYSQLDUMP –skip-lock-tables -u $MyUser $db | $GZIP -9 > $FILE

Por admin

Deja una respuesta

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Powered By
Best Wordpress Adblock Detecting Plugin | CHP Adblock