Quantcast
Channel: MySQL Forums - MySQL Workbench - Database Migration
Viewing all articles
Browse latest Browse all 561

The Problem Due to wrong passwords in the database of mysql/logmysql is not able to connect to the database with the existing password. We need to change the passwords manually. The Error The error might looks like this. #logmysql ERROR 1044: Acc (no replies)

$
0
0
The Problem
Due to wrong passwords in the database of mysql/logmysql is not able to connect to the database with the existing password. We need to change the passwords manually.

The Error
The error might looks like this.

#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'
For Mysql Database
1. Stop the mysql service. [Run as Zimbra]

$ mysql.server stop
2. Modify the /opt/zimbra/bin/mysql.server to start the mysql with skipping the grant tables. [Run as ROOT]

# vi /opt/zimbra/bin/mysql.server

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.

3. Start the mysql service. [Run as Zimbra]

$ mysql.server start
4. Connect to the database and change the passwords.

# 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 in the localconfig. Run following command to check those passwords.

zmlocalconfig -s | grep mysql_root_password
zmlocalconfig -s | grep zimbra_mysql_password
Flush the privileges and exit.

mysql> FLUSH PRIVILEGES;
mysql> exit
5. Go back to the file remove the --skip-grant-tables from /opt/zimbra/bin/mysql.server and save and exit the file. You will need to do it as root.

6. Stop and start the mysql service. [Run as zimbra]

$ mysql.server stop
$ mysql.server start
7. Now you should be able to connect to the mysql.

$ mysql zimbra
For logger database
1. Stop the logger mysql service. [Run as Zimbra]

$ logmysql.server stop
2. Modify the /opt/zimbra/bin/logmysql.server to start the logmysql with skipping the grant tables. [Run as ROOT]

# vi /opt/zimbra/bin/logmysql.server
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.

3. Start the logmysql service. [Run as Zimbra]

$ logmysql.server start
4. Connect to the database and change the passwords.

# 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 in the localconfig. Run following command to check those passwords.

zmlocalconfig -s | grep mysql_logger_root_password
zmlocalconfig -s | grep zimbra_logger_mysql_password
Flush the privileges and exit.

mysql> FLUSH PRIVILEGES;
mysql> exit
5. Go back to the file remove the --skip-grant-tables from /opt/zimbra/bin/logmysql.server and save and exit the file. You will need to do it as root.

6. Stop and start the mysql service. [Run as zimbra]

$ logmysql.server stop
$ logmysql.server start
7. Now you should be able to connect to the logmysql.

Viewing all articles
Browse latest Browse all 561

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>