Difference between revisions of "Issues with mysql and logmysql passwords"
(New page: '''Issue:''' Due to wrong passwords in the database mysql/logmysql is not able to connect to the database with the existing password. We need to change the passwords manually. '''Error'...) |
|||
Line 1: | Line 1: | ||
'''Issue:''' | '''Issue:''' | ||
+ | |||
Due to wrong passwords in the database mysql/logmysql is not able to connect to the database with the existing password. | Due to wrong passwords in the database mysql/logmysql is not able to connect to the database with the existing password. | ||
We need to change the passwords manually. | We need to change the passwords manually. | ||
+ | |||
'''Error''': | '''Error''': | ||
− | # | + | #logmysql |
− | ERROR 1044: Access denied for user 'zimbra'@'localhost' to database ' | + | |
+ | ERROR 1044: Access denied for user 'zimbra'@'localhost' to database 'zimbra_logger' | ||
+ | |||
+ | |||
+ | #mysql | ||
+ | |||
+ | |||
+ | ERROR 1044: Access denied for user 'zimbra'@'localhost' to database 'zimbra' | ||
'''Steps''': | '''Steps''': | ||
− | |||
− | + | 1) For Mysql: | |
− | b) Run as ROOT vi /opt/zimbra/bin/mysql.server | + | a) Stop the mysql service. [Run as Zimbra: mysql.server stop] |
+ | |||
+ | b) Run as ROOT vi /opt/zimbra/bin/mysql.server | ||
− | c) Modify the following: | + | c) Modify the following: |
--defaults-file=${mysql_mycnf} \ | --defaults-file=${mysql_mycnf} \ | ||
--external-locking \ | --external-locking \ | ||
--ledir=${mysql_directory}/libexec < /dev/null > /dev/null 2>&1 & | --ledir=${mysql_directory}/libexec < /dev/null > /dev/null 2>&1 & | ||
− | TO | + | |
+ | TO | ||
--defaults-file=${mysql_mycnf} \ | --defaults-file=${mysql_mycnf} \ | ||
Line 31: | Line 42: | ||
--ledir=${mysql_directory}/libexec < /dev/null > /dev/null 2>&1 --skip-grant-tables & | --ledir=${mysql_directory}/libexec < /dev/null > /dev/null 2>&1 --skip-grant-tables & | ||
− | Save and Exit the file. | + | Save and Exit the file. |
− | d) Start the mysql service. [Run as Zimbra: mysql.server start] | + | d) Start the mysql service. [Run as Zimbra: mysql.server start] |
− | e) Connect to the database. | + | e) Connect to the database. |
− | # mysql | + | # mysql |
− | Welcome to the MySQL monitor. Commands end with ; or \g. | + | Welcome to the MySQL monitor. Commands end with ; or \g. |
− | Your MySQL connection id is 6883 | + | Your MySQL connection id is 6883 |
− | Server version: 5.0.45-log Source distribution | + | Server version: 5.0.45-log Source distribution |
− | Type 'help;' or '\h' for help. Type '\c' to clear the buffer. | + | Type 'help;' or '\h' for help. Type '\c' to clear the buffer. |
− | mysql> UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root'; ----> Root user. | + | mysql> UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root'; ----> Root user. |
− | mysql> UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='zimbra'; ----> Zimbra user. | + | mysql> UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='zimbra'; ----> Zimbra user. |
− | Make sure the password you specify is should be same as | + | Make sure the password you specify is should be same as |
− | + | zmlocalconfig -s | grep mysql_root_password and zmlocalconfig -s | grep zimbra_mysql_password. | |
− | mysql> | + | mysql> FLUSH PRIVILEGES; |
− | + | mysql> exit | |
− | g) Stop and start the mysql service. [mysql.server stop and start] | + | f) Go back to the file remove the --skip-grant-tables and save and exit the file. |
+ | |||
+ | g) Stop and start the mysql service. [mysql.server stop and start] | ||
− | h) Now try to connect without the --skip-grant-tables option and check. | + | h) Now try to connect without the --skip-grant-tables option and check. |
Line 67: | Line 80: | ||
'''2) For Logmysql:''' | '''2) For Logmysql:''' | ||
− | a) Stop the logmysql service. [Run as Zimbra: logmysql.server stop] | + | a) Stop the logmysql service. [Run as Zimbra: logmysql.server stop] |
− | b) Run as ROOT vi /opt/zimbra/bin/logmysql.server | + | b) Run as ROOT vi /opt/zimbra/bin/logmysql.server |
− | c) Modify the following: | + | c) Modify the following: |
--defaults-file=${logger_mysql_mycnf} \ | --defaults-file=${logger_mysql_mycnf} \ | ||
Line 77: | Line 90: | ||
--ledir=${logger_mysql_directory}/libexec & | --ledir=${logger_mysql_directory}/libexec & | ||
− | TO | + | |
+ | TO | ||
--defaults-file=${logger_mysql_mycnf} \ | --defaults-file=${logger_mysql_mycnf} \ | ||
Line 83: | Line 97: | ||
--ledir=${logger_mysql_directory}/libexec --skip-grant-tables & | --ledir=${logger_mysql_directory}/libexec --skip-grant-tables & | ||
− | Save and Exit the file. | + | Save and Exit the file. |
+ | |||
+ | d) Start the logmysql service. [Run as Zimbra: logmysql.server start] | ||
− | + | e) Connect to the database. | |
− | + | # logmysql | |
− | + | Welcome to the MySQL monitor. Commands end with ; or \g. | |
+ | Your MySQL connection id is 6883 | ||
+ | Server version: 5.0.45-log Source distribution | ||
− | + | Type 'help;' or '\h' for help. Type '\c' to clear the buffer. | |
− | |||
− | |||
− | + | mysql> UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root'; ----> Root user. | |
− | mysql> UPDATE mysql.user SET Password=PASSWORD('password') WHERE User=' | + | mysql> UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='zimbra'; ----> Zimbra user. |
− | + | Make sure the password you specify is should be same as | |
− | + | zmlocalconfig -s | grep mysql_logger_root_password and zmlocalconfig -s | grep zimbra_logger_mysql_password | |
− | mysql> FLUSH PRIVILEGES; | + | mysql> FLUSH PRIVILEGES; |
− | mysql> exit | + | mysql> exit |
− | f) Go back to the file remove the --skip-grant-tables and save and exit the file. | + | f) Go back to the file remove the --skip-grant-tables and save and exit the file. |
− | g) Stop and start the logmysql service. [logmysql.server stop and start] | + | g) Stop and start the logmysql service. [logmysql.server stop and start] |
− | h) Now try to connect without the --skip-grant-tables option in the file and check. | + | h) Now try to connect without the --skip-grant-tables option in the file and check. |
Revision as of 10:43, 13 February 2008
Issue:
Due to wrong passwords in the database mysql/logmysql is not able to connect to the database with the existing password.
We need to change the passwords manually.
Error:
- logmysql
ERROR 1044: Access denied for user 'zimbra'@'localhost' to database 'zimbra_logger'
- mysql
ERROR 1044: Access denied for user 'zimbra'@'localhost' to database 'zimbra'
Steps:
1) For Mysql:
a) Stop the mysql service. [Run as Zimbra: mysql.server stop] b) Run as ROOT vi /opt/zimbra/bin/mysql.server
c) Modify the following:
--defaults-file=${mysql_mycnf} \ --external-locking \ --ledir=${mysql_directory}/libexec < /dev/null > /dev/null 2>&1 & TO
--defaults-file=${mysql_mycnf} \ --external-locking \ --ledir=${mysql_directory}/libexec < /dev/null > /dev/null 2>&1 --skip-grant-tables &
Save and Exit the file.
d) Start the mysql service. [Run as Zimbra: mysql.server start]
e) Connect to the database.
# mysql
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 6883 Server version: 5.0.45-log Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root'; ----> Root user.
mysql> UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='zimbra'; ----> Zimbra user.
Make sure the password you specify is should be same as
zmlocalconfig -s | grep mysql_root_password and zmlocalconfig -s | grep zimbra_mysql_password.
mysql> FLUSH PRIVILEGES;
mysql> exit
f) Go back to the file remove the --skip-grant-tables and save and exit the file. g) Stop and start the mysql service. [mysql.server stop and start]
h) Now try to connect without the --skip-grant-tables option and check.
2) For Logmysql:
a) Stop the logmysql service. [Run as Zimbra: logmysql.server stop]
b) Run as ROOT vi /opt/zimbra/bin/logmysql.server
c) Modify the following:
--defaults-file=${logger_mysql_mycnf} \ --external-locking \ --ledir=${logger_mysql_directory}/libexec &
TO
--defaults-file=${logger_mysql_mycnf} \ --external-locking \ --ledir=${logger_mysql_directory}/libexec --skip-grant-tables &
Save and Exit the file.
d) Start the logmysql service. [Run as Zimbra: logmysql.server start]
e) Connect to the database.
# logmysql
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 6883 Server version: 5.0.45-log Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root'; ----> Root user.
mysql> UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='zimbra'; ----> Zimbra user.
Make sure the password you specify is should be same as
zmlocalconfig -s | grep mysql_logger_root_password and zmlocalconfig -s | grep zimbra_logger_mysql_password
mysql> FLUSH PRIVILEGES;
mysql> exit
f) Go back to the file remove the --skip-grant-tables and save and exit the file.
g) Stop and start the logmysql service. [logmysql.server stop and start]
h) Now try to connect without the --skip-grant-tables option in the file and check.