Blackhold

mysql: debian-sys-maint

Posted on setembre 22nd, 2010 by admin

Una de las maquinas me está soltando este error:

/etc/cron.daily/logrotate:
error: error running shared postrotate script for ‘/var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log ‘
run-parts: /etc/cron.daily/logrotate exited with return code 1

también veremos que si queremos reiniciar el mysql nos saca este error:

# /etc/init.d/mysql stop
Stopping MySQL database server: mysqld failed!
# /etc/init.d/mysql start
Starting MySQL database server: mysqld already running.
/usr/bin/mysqladmin: connect to server at ‘localhost’ failed
error: ‘Access denied for user ‘debian-sys-maint’@’localhost’ (using password: YES)’


el motivo es que el usuario debian-sys-maint no tiene derechos para realizar los rotates, así que lo necesario será definir correctamente los derechos y en este caso el password.

el password lo encontramos en el fichero /etc/mysql/debian.cnf

# vi /etc/mysql/debian.cnf
# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host = localhost
user = debian-sys-maint
password = password_alfanumerico
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
user = debian-sys-maint
password = password_alfanumerico
socket = /var/run/mysqld/mysqld.sock
basedir = /usr

y a continuación entramos como root a mysql:

# mysql
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘debian-sys-maint’@’localhost’ IDENTIFIED BY ‘password_alfanumerico’ WITH GRANT OPTION;
mysql> flush privileges;

y probamos de reiniciar de nuevo el servicio:

# /etc/init.d/mysql restart
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld . ..
Checking for corrupt, not cleanly closed and upgrade needing tables..

Y solucionado :)

This entry was posted on dimecres, setembre 22nd, 2010 at 10:18 and is filed under bbdd. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Response to “mysql: debian-sys-maint”

Leave a Response

« »

guy fawkes