Difference between revisions of "Resetting LDAP & MySQL Passwords"

(Resetting the Logger Password)
(Resetting the MySQL Password)
Line 130: Line 130:
  
 
== Resetting the MySQL Password ==
 
== Resetting the MySQL Password ==
 +
 +
First, we need to make sure that Zimbra is stopped.
 +
 +
Try running:
 +
 +
>su zimbra
 +
 +
>zmcontrol stop
 +
 +
Just to be safe, you can make sure that all Zimbra services are stopped:
 +
 +
>ps auxww | grep zimbra
 +
 +
>ps auxww | grep mysql
 +
 +
Kill any left over processes.
 +
 +
Now, we can reset the passwords:
 +
 +
'''root account'''<br>
 +
For the root mysql account, you need to start the mysql logger instance with the --skip-grant-tables option.  As root, modify the /opt/zimbra/bin/mysql.server file:
 +
 +
 +
''Change:''
 +
 +
<code>
 +
'start') <br>
 +
<nowiki>#--defaults-file must be first argument</nowiki> <br>
 +
cd ${mysql_directory}; \ <br>
 +
${mysql_directory}/bin/mysqld_safe \ <br>
 +
--defaults-file=${mysql_mycnf} \ <br>
 +
--ledir=${mysql_directory}/bin & <br>
 +
;; <br>
 +
</code>
 +
 +
''To:''
 +
 +
<code>
 +
'start') <br>
 +
<nowiki># --defaults-file must be first argument</nowiki> <br>
 +
cd ${mysql_directory}; \ <br>
 +
${mysql_directory}/bin/mysqld_safe \ <br>
 +
--defaults-file=${mysql_mycnf} \ <br>
 +
<b>--skip-grant-tables \ </b><br>
 +
--ledir=${mysql_directory}/bin & <br>
 +
;;<br>
 +
</code>
 +
 +
Save the file & start the server as the zimbra user:
 +
 +
>su - zimbra
 +
>mysql.server start
 +
 +
Use the mysql command to connect to the logger database:
 +
 +
>mysql mysql  -P 7306
 +
 +
If your mysql database is running on a different port, change it via the -P parameter.  This information is available in the /opt/zimbra/conf/my.cnf file.
 +
 +
Execute the password change:
 +
 +
><code>>update user set password=PASSWORD('newpasswd') where user='root';</code>
 +
 +
Optionally force-change the zimbra user password:
 +
 +
  ><code>>update user set password=PASSWORD('newzimbrapasswd') where user='zimbra';</code>
 +
 +
Changing "newpasswd" or "newzimbrapasswd" with your desired passwords.
 +
 +
Then:
 +
 +
>flush privileges
 +
>(quit or ctrl+d)
 +
 +
Now make sure that the new password you have selected matches the value of mysql_root_password:
 +
 +
> zmlocalconfig -s -m nokey mysql_root_password
 +
 +
If it doesn't, adjust the mysql_root_password parameter in /opt/zimbra/conf/localconfig.xml
 +
 +
Once the passwords match, we must clean up.  As the zimbra user, shutdown the mysql service:
 +
 +
> mysql.server stop
 +
 +
Now, as root, edit the mysql.server file and remove the previously added --skip-grant-tables option.
 +
 +
After that, start the service:
 +
 +
> mysql.server start
 +
 +
And your set!
 +
 +
 +
'''zimbra account'''
 +
 +
For the zimbra luser, we can adjust the password via the zmmypasswd command (as zimbra):
 +
 +
  >zmmypasswd newpasswd
 +
 +
Of course changing "newpasswd" with your desired password.

Revision as of 07:15, 8 June 2006

One of the most common problems with installing and starting a service is an incorrect LDAP or MySQL password.


Resetting the LDAP Password

First, we need to make sure that Zimbra is stopped.

Try running:

>su zimbra
>zmcontrol stop

Just to be safe, you can make sure that all Zimbra services are stopped:

>ps auxww | grep zimbra
>ps auxww | grep slapd


Kill any left over processes.

Now, we can reset the passwords:

First the root(note: these are run as user zimbra)

>zmldappasswd --root newpass

Next the zimbra:

>zmldappasswd newpass

Make sure you use the same password for both!

Resetting the Logger Password

In the event you have lost your logger password, or it has otherwise become out of sync after an upgrade, you can reset it. Keep in mind that the logger is not a required component to have running.

First, we need to make sure that Zimbra is stopped.

Try running:

>su zimbra
>zmcontrol stop

Just to be safe, you can make sure that all Zimbra services are stopped:

>ps auxww | grep zimbra
>ps auxww | grep mysql

Kill any left over processes.

Now, we can reset the passwords:

root account
For the root mysql logger account, you need to start the mysql logger instance with the --skip-grant-tables option. As root, modify the /opt/zimbra/bin/logmysql.server file:


Change:

'start')
#--defaults-file must be first argument
cd ${mysql_directory}; \
${mysql_directory}/bin/mysqld_safe \
--defaults-file=${mysql_mycnf} \
--ledir=${mysql_directory}/bin &


To:

'start')
# --defaults-file must be first argument
cd ${mysql_directory}; \
${mysql_directory}/bin/mysqld_safe \
--defaults-file=${mysql_mycnf} \
--skip-grant-tables \
--ledir=${mysql_directory}/bin &


Save the file & start the server as the zimbra user:

>su - zimbra
>logmysql.server start

Use the mysql command to connect to the logger database:

>mysql mysql -D zimbra_logger -P 7307

If your logger database is running on a different port, change it via the -P parameter. This information is available in the /opt/zimbra/conf/my.logger.cnf file.

Execute the password change:

>>update user set password=PASSWORD('newpasswd') where user='root';
>flush privileges
>(quit or ctrl+d)

Changing "newpasswd" with your desired root password.

Now make sure that the new password you have selected matches the value of mysql_logger_root_password:

> zmlocalconfig -s -m nokey mysql_logger_root_password

If it doesn't, adjust the mysql_logger_root_password parameter in /opt/zimbra/conf/localconfig.xml

Once the passwords match, we must clean up. As the zimbra user, shutdown the logmysql service:

> logmysql.server stop

Now, as root, edit the logmysql.server and remove the previously added --skip-grant-tables option.

After that, start the service:

> logmysql.server start

And your set!


zimbra account

For the zimbra logger user, we can adjust the password via the zmmylogpasswd command (as zimbra):

 >zmmylogpasswd newpasswd

Of course changing "newpasswd" with your desired password.

Resetting the MySQL Password

First, we need to make sure that Zimbra is stopped.

Try running:

>su zimbra
>zmcontrol stop

Just to be safe, you can make sure that all Zimbra services are stopped:

>ps auxww | grep zimbra
>ps auxww | grep mysql

Kill any left over processes.

Now, we can reset the passwords:

root account
For the root mysql account, you need to start the mysql logger instance with the --skip-grant-tables option. As root, modify the /opt/zimbra/bin/mysql.server file:


Change:

'start')
#--defaults-file must be first argument
cd ${mysql_directory}; \
${mysql_directory}/bin/mysqld_safe \
--defaults-file=${mysql_mycnf} \
--ledir=${mysql_directory}/bin &


To:

'start')
# --defaults-file must be first argument
cd ${mysql_directory}; \
${mysql_directory}/bin/mysqld_safe \
--defaults-file=${mysql_mycnf} \
--skip-grant-tables \
--ledir=${mysql_directory}/bin &


Save the file & start the server as the zimbra user:

>su - zimbra
>mysql.server start

Use the mysql command to connect to the logger database:

>mysql mysql  -P 7306

If your mysql database is running on a different port, change it via the -P parameter. This information is available in the /opt/zimbra/conf/my.cnf file.

Execute the password change:

>>update user set password=PASSWORD('newpasswd') where user='root';

Optionally force-change the zimbra user password:

 >>update user set password=PASSWORD('newzimbrapasswd') where user='zimbra';

Changing "newpasswd" or "newzimbrapasswd" with your desired passwords.

Then:

>flush privileges
>(quit or ctrl+d)

Now make sure that the new password you have selected matches the value of mysql_root_password:

> zmlocalconfig -s -m nokey mysql_root_password

If it doesn't, adjust the mysql_root_password parameter in /opt/zimbra/conf/localconfig.xml

Once the passwords match, we must clean up. As the zimbra user, shutdown the mysql service:

> mysql.server stop

Now, as root, edit the mysql.server file and remove the previously added --skip-grant-tables option.

After that, start the service:

> mysql.server start

And your set!


zimbra account

For the zimbra luser, we can adjust the password via the zmmypasswd command (as zimbra):

 >zmmypasswd newpasswd

Of course changing "newpasswd" with your desired password.

Jump to: navigation, search