chr4-cookbooks / mysqld

chef cookbook for installing and configuring mysql, only changing explicitly given options from the systems defaults
4 stars 11 forks source link

Debian 8 fails to update password #9

Closed aalmenar closed 8 years ago

aalmenar commented 8 years ago

When using the default mysql (At this time 5.5.52 on debian 8) password doesn't get updated and mysql root user remains without password.

Updating authentication_string has no effect on this version. Searching over the web found the following:

MySQL 5.7.5 and earlier version: SET PASSWORD FOR 'user_name' = PASSWORD('new_password');

MySQL 5.7.6 and later version: alter user 'user_name' identified by 'new_password';

Also, the execution of the query fails with a "no database selected". fixed on a copy of the cookbook locally, but also the authentication_string also was of no effect to change the password.

chr4 commented 8 years ago

Support for mysql < 5.7 was dropped with the cookbook version 2.0.0.

You can either version-lock the cookbook to ~> 1.0.5 to keep using the old version, or use mysql-5.7 or mariadb 10.1 (recommended). The latter can be easily installed from the official repositories by using the mysqld::mariadb_repository recipe.

chr4 commented 8 years ago

Maybe I should be more precise in the README, I wasn't aware that the authentication_string change was introduced between two subversions of 5.7. I was assuming the change was introduced with the version-bump from 5.6->5.7.

Dens49 commented 8 years ago

Even though the documentation that I linked to in my earlier pull request explicitly states that the change came with 5.7.6, I failed to mention that detail in my pull request. Sorry for that!

chr4 commented 8 years ago

I added a note to the README in 612fb73ccf1188d3ecf13ddb00b9dc0dd0c5d53d

chr4 commented 8 years ago

I believe this is the most practical approach of handling this, as supporting both generations of databases results in a lot of overhead, which will eventually faded out once migration is complete (e.g. next Debian release).

Closing this. Feel free to comment/ reopen if there's additional problems. Thanks for the report!