Skip to content
This repository was archived by the owner on Jun 11, 2019. It is now read-only.

Conversation

@RobQuistNL
Copy link
Contributor

It seems like orginally the mysql file .my.cfg wasn't used, plus the parameters host, password & username weren't used in the command yet.

@alvagante
Copy link
Member

Well the my.cnf file was actually used by default, since Puppet runs as root.
The fix for different users actually is weclomed, but please give me some time to properly test this in running environments. For example, I would keep the mysql_db a required filed and avoid any change in the query file that would trigger a new sql query command.

@Freeaqingme
Copy link
Contributor

@example42 The problem was that although mysql runs as root, $MYSQL_HOME wasn't set in our puppet run, and therefore the .my.cnf file was ignored. I assume this is why the other classes also rely on the --defaults-file option (like mysql::user or mysql::grant).

Furthermore, the query we were trying to execute was a 'create database' statement, which clearly does not require a database (there are more queries possible that do not require a database). By leaving the db option empty, the use statement became "USE ;" which resulted in a mysql syntax error. I'm not sure if this could be fixed without touching the template (except for duplicating it).

Edit; fyi, @RobQuistNL is a colleague of mine.

@alvagante alvagante merged commit f6c6d41 into example42:master Apr 6, 2013
@alvagante
Copy link
Member

Ok, merged, thank you I fixed with the same approach the mysql::queryfile define, that had a similar issue.
Note that I changed the template in order to avoid accidental re-executions of the query.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants