[chef] mysql and root password


Chronological Thread 
  • From: S Ahmed < >
  • To:
  • Subject: [chef] mysql and root password
  • Date: Sun, 15 Apr 2012 22:47:44 -0400

Confused how I should be handling the root password with the mysql recipe.

After it installed, I couldn't access the mysql instance since I didn't know the password.

1. I stopped the mysql service.
2. mysqld_safe --skip-grant-tables &
3. mysql -u root
changed password for root
4. tried to stop the mysql server:

sudo /etc/init.d/mysql stop
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql stop

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) utility, e.g. stop mysql

How can I stop it?  (I got around it by killing the process via kill -9 1234)

5. started the service up again, my root password now works.


***But now, if I re-run my chef-solo script, I get this:

[Mon, 16 Apr 2012 02:43:09 +0000] ERROR: Running exception handlers
[Mon, 16 Apr 2012 02:43:09 +0000] ERROR: Exception handlers complete
[Mon, 16 Apr 2012 02:43:09 +0000] FATAL: Stacktrace dumped to /home/ubuntu/chef/chef-stacktrace.out
[Mon, 16 Apr 2012 02:43:09 +0000] FATAL: Chef::Exceptions::ShellCommandFailed: execute[mysql-install-privileges] (mysql::server line 136) had an error: Chef::Exceptions::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /usr/bin/mysql -u root -p"QNX7GkHcx7cbU65BYxGb" < /etc/mysql/grants.sql ----
STDOUT: 
STDERR: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
---- End output of /usr/bin/mysql -u root -p"QNX7GkHcx7cbU65BYxGb" < /etc/mysql/grants.sql ----
Ran /usr/bin/mysql -u root -p"QNX7GkHcx7cbU65BYxGb" < /etc/mysql/grants.sql returned 1

I guess it is generating a random password and trying to login somehow, what should I change now?



Archive powered by MHonArc 2.6.16.

§