-
-
Notifications
You must be signed in to change notification settings - Fork 690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mysql_user or mysql_database can not connect to the database #674
Comments
Same issue here |
I ran into this issue too. The resources should add a property: ctrl_socket or something like that to allow user to specify the socket. |
Some news for this topic? |
@dkd-kaehm don't think so, I did not get any feedback since I created the issue |
@doganoo Following helped me: after mysql_service -> start the server is not fully initialized and rejects the connection for mysql_database, mysql_user resources, so i added
IMHO the mysql_service -> start action should wait for mysql service is really ready. |
Here is two issues - incorrect socket location to use for MySQL8 (Tested on Rocky8 mysql-community-server-8.0.34) and bug inside resource when compiling 'ctrl' hash. Please see screenshot, this is from recipe with one 'mysql_user' resource. This is one operation but compare Control Hash and SQL for first and second requests.
Function 'run_query' https://github.com/sous-chefs/mysql/blob/main/resources/mysql_user.rb#L67C7-L67C16 force to use host and port in the Control Hash, this leads to use cookbook default incorrect socket file in the 'sql_command_string' function https://github.com/sous-chefs/mysql/blob/main/libraries/helpers.rb#L360. |
🗣️ Foreword
Thank you for providing this awesome cookbook.
👻 Brief Description
When trying to use the mysql_database and mysql_user resources, Chef throws error with "Can't connect to local MySQL server through socket '/var/run/mysql/mysqld.sock".
Please notice I am not trying to connect on the shell within the Vagrant Box.
The Cookbook:
The my_cnf.erb
The kitchen.yml:
attributes/apparmor.rb:
🥞
Cookbook Version: 11.0.0
Chef Workstation version: 21.11.679
Chef Infra Client version: 17.7.29
Chef InSpec version: 4.49.0
Chef CLI version: 5.4.2
Chef Habitat version: 1.6.420
Test Kitchen version: 3.1.1
Cookstyle version: 7.25.9
Steps To Reproduce
Steps to reproduce the behavior:
🚓 Expected behavior
A running MySQL instance with the given user/database
Error:
Please let me know if you need additional information. Thank you in advance!
The text was updated successfully, but these errors were encountered: