-
Notifications
You must be signed in to change notification settings - Fork 364
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
formula does not set root password #124
Comments
at installation of the Did you try to log without password? Could you post lookup part of the pillar? |
probably also apply to saltstack-formulas#104, saltstack-formulas#106
when i install the mysql.5.7.4 use rpm package on CentOS7.2,I encounted the same error,i search a lot.found a random password was genarated in /var/lib/mysql/.mysql_secret,so how can i get that in sls File and log in? |
in {% elif os_family == 'RedHat' or 'Suse' %}
mysql_root_password:
cmd.run:
- name: mysqladmin --user {{ mysql_root_user }} password '{{ mysql_root_password|replace("'", "'\"'\"'") }}'
- unless: mysql --user {{ mysql_root_user }} --password='{{ mysql_root_password|replace("'", "'\"'\"'") }}' --execute="SELECT 1;"
- require:
- service: mysqld
what do you get if you execute this on the minion? salt-call grains.get os_family |
hi, From: Sylvain303 what do you get if you execute this on the minion? |
hi, From: Sylvain303 what do you get if you execute this on the minion? |
@lizard1990, so it means that your OS is detected as Try to catch part of the output in the following command on the minion. We are looking for the command which install the mysql package, it depends of the
Also you should check your pillar values, you can check (on the minion) Remove or alter private data, passwords, etc. if you want to share.
Yes, did you manage to connect you mysql on the minion from command line? See example from Debian in my ticket #120 you will need to adapt to your OS. That may helps. |
yes,i connect mysql on the minion from command line,it got the same error,the mysql need a password, |
@lizard1990, so to sum it up, it doesn't works with mysql.5.7.4 on CentOS 7.2.1511, but works with mysql5.1.73 on CentOS6.7, so you downgraded your OS version, right? If I understand it well, you could use, on mysql.5.7.4 on CentOS 7.2.1511, the pass generated in This command may allow you to connect with root privileges to the freshly installed mysql:
If the file is in the same format as This file seems to come from mysql_install_db — Initialize MySQL Data Directory |
Confirming this bug on CentOS 7.2 This formula cannot configure MySQL on 7.2 it seems. |
Yep. The new RPM for CentOS 7.2 generates a random password and logs it. We'll have to get the random pass from the logs and use it to change the pass in order for this formula to work with this version again: http://www.if-not-true-then-false.com/2010/install-mysql-on-fedora-centos-red-hat-rhel/ |
So I hit a snag with this, where the generated root password does not get logged. However, I found a workaround that will fix this formula:
We just need to pass |
Ahh, in MySQL 5.7, database should be initialized with They've replaced the command, for the better.
|
Ok, so I've nailed down the issue with this formula, it's the solution I'm having issues with. I've almost got it, and if someone can tell me how to make a state require another state, we'll be good. The problem: With Mysql 5.7, if the service detects that the database is not initialized on startup, it initializes it. As of MySQL 5.7, that is done with a random password generated for root. This password should be logged to the MySQL log, however on multiple tries with a Vagrant box, it was not logged anywhere. This isn't an issue on Debian, as the password is set with debconf before the service is started. On Arch, this formula is calling mysql_install_db - which will cause the same problem. To fix Arch, the formula needs to call On Redhat systems, the service absolutely cannot be started until the database is configured with this command, or we're hosed. There's no guaranteed way to retrieve the password afterwards. To fix this I created a state that initialises the DB and added it to server.sls:
So long as this gets called before the Does anyone know how to require this?
|
Pull request submitted. |
When using the
root_password
option in the pillar.example to set the root password, I am unable to login as root using the root password:The login attempt:
The output from debconf:
The text was updated successfully, but these errors were encountered: