Comments (17)
Still experiencing this bug with Ansible 2.0.1.0.
Setting mysql_root_password_update
to yes
as suggested above seems to work.
from ansible-role-mysql.
I have the same error. I have an existing mysql database, and wanted to run this role to ensure that the correct tables and users exist, but it fails on this task
from ansible-role-mysql.
i have the same error. this is the first time i use this role.
TASK: [geerlingguy.mysql | Get list of hosts for the anonymous user.] *********
failed: [localhost] => {"changed": false, "cmd": ["mysql", "-NBe", "SELECT Host
FROM mysql.user WHERE User = \"\""], "delta": "0:00:00.024041", "end": "2015-06-
15 12:23:12.498852", "rc": 1, "start": "2015-06-15 12:23:12.474811", "stdout_lin
es": [], "warnings": []}
stderr: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using pas
sword: NO)
from ansible-role-mysql.
I'm now sometimes getting:
TASK: [geerlingguy.mysql | Get list of hosts for the root user.] **************
failed: [drupaldev] => {"changed": false, "cmd": ["mysql", "-NBe", "SELECT Host FROM mysql.user WHERE User = \"root\" ORDER BY (Host=\"localhost\") ASC"], "delta": "0:00:00.004044", "end": "2015-06-19 19:29:25.622041", "rc": 1, "start": "2015-06-19 19:29:25.617997", "stdout_lines": [], "warnings": []}
stderr: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
If running the playbook when MySQL was never started correctly (e.g. first provisioning/boot didn't actually start MySQL for some reason).
It seems the following task (which reports ok
on my environment) is not actually ok
; or else maybe MySQL is not listening on a socket/port correctly...
- name: Ensure MySQL is started and enabled on boot.
service: "name={{ mysql_daemon }} state=started enabled={{ mysql_enabled_on_startup }}"
from ansible-role-mysql.
I think this could be a bug with Ubuntu 14.04 (and possibly 12.04) service handling with Ansible's service
module in 1.9.1. Going to downgrade to 1.9.0.1 and see if it's cleared up...
from ansible-role-mysql.
This particular bug just seems to indicate that MySQL needs a restart (at least in the few cases I've seen it happening)βmost often because MySQL is listening only on at TCP port, and needs to be restarted to listen on a socket.
from ansible-role-mysql.
And note that simply switching to Ansible 1.9.0.1 has fixed all the issues for me. 1.9.2 should also work, but it's still only in rc1 status (See: https://groups.google.com/forum/#!topic/ansible-devel/jfm6pZSLUYY).
So as a workaround, please do the following (if you installed Ansible with pip):
sudo pip uninstall ansible
sudo pip install ansible==1.9.0.1
Hopefully that solves the problem for others until Ansible 1.9.2+ is released!
from ansible-role-mysql.
Just chiming in for others who arrive here: having some issues on ubuntu 14.04 and packer.io builds, giving downgrade a whirl as @geerlingguy mentioned.
from ansible-role-mysql.
Im experiencing this issue on Ansible 1.9.3
from ansible-role-mysql.
@rvanbaalen - Can you try setting mysql_root_password_update
to yes
in your variables, and see if that makes this work?
from ansible-role-mysql.
I'm also getting this.
TASK: [geerlingguy.mysql | Get list of hosts for the anonymous user.] *********
failed: [54.194.51.168] => {"changed": false, "cmd": ["mysql", "-NBe", "SELECT Host FROM mysql.user WHERE User = \"\""], "delta": "0:00:00.004040", "end": "2016-03-24 17:47:36.733753", "rc": 1, "start": "2016-03-24 17:47:36.729713", "stdout_lines": [], "warnings": []}
stderr: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
I have tried the following configurations and all 3 generate this error:
Basic config:
overwrite_global_mycnf: yes
mysql_databases:
- name: <mydbname>
encoding: utf8
collation: utf8_general_ci
mysql_users:
- name: <myusername>
host: "localhost"
password: <myuserpassword>
priv: "<mydbname>.*:ALL"
mysql_enabled_on_startup: yes
Adding root mysql_root_password
:
mysql_root_password: <myrootpassword>
And then adding mysql_root_password_update: yes
mysql_root_password: <myrootpassword>
mysql_root_password_update: yes
I'm using the most up-to-date ansible as provided by brew.
$ ansible --version
ansible 1.9.3
In between attempts I killed mysql by running:
#! /bin/bash
sudo service mysql stop
sudo apt-get purge -y mysql-server mysql-client mysql-common mysql-server-core-5.5 mysql-client-core-5.5
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get -y autoremove
sudo apt-get autoclean
sudo rm ~/.my.cnf
sudo rm -r /etc/mysql/
I'll keep trying to find a solution, but if you have a suggestion that would be great. I'll post if I work it out.
from ansible-role-mysql.
@perchten Maybe try installing Ansible via pip rather than brew? That way you can go higher than v1.9.3 (v2 is now latest stable).
from ansible-role-mysql.
will try that - have had pain-in-the-ass issues with pip before. But that's unrelated.
Just wanted to say, a restart of mysql server just before that task had no impact. Just fyi.
from ansible-role-mysql.
Upgraded to 2.0.1.0. No luck. Still the same error as I posted above.
What sticks out for me is that the error is for root access without password (Access denied for user 'root'@'localhost' (using password: NO)
). Surely, given that this follows the tasks which set the root password, this call should be using the password?
I suggest reopening this issue. The offered solution is just a workaround, and now there's evidence it doesn't work in all cases.
from ansible-role-mysql.
I am getting the same error on Travis Ubuntu Trusty vm and not on Vagrant Trusty
so, nice and obscure for sure
this is my play, which does not work
- hosts: localhost
remote_user: root
become_user: root
become: yes
become_method: sudo
vars:Use default log file size so Travis CI VM allows MySQL restart.
- mysql_innodb_log_file_size: "5M"
- mysql_root_username: root
- mysql_root_password: root
- mysql_root_password_update: yes
roles:- role: geerlingguy.mysql
become_user: root
become: yes
become_method: sudo- role: getvalkyrie.drush
- role: ansible-role-aegir
from ansible-role-mysql.
Same error here using Ubuntu 16.10 x64
from ansible-role-mysql.
Same error using Ubuntu 16.04, able to login interactively , using mysql -u root -p
but fail in the playbook and also if I try mysql -Nbe ...
from ansible-role-mysql.
Related Issues (20)
- Allow custom MariaDB version using upstream repos HOT 2
- Check master replication status. HOT 3
- Skip replication tasks HOT 8
- Change mysql_bind_address: '0.0.0.0' to mysql_bind_address: '127.0.0.1' in defaults HOT 2
- Add additional innodb tunables to configuration HOT 4
- Missing community.mysql HOT 2
- ERROR! 'include_tasks' is not a valid attribute for a Play HOT 4
- MySQL fails to start when `mysql_datadir` is set to anything other than MySQL's default HOT 13
- Make apt update_cache optional or ignore errors HOT 2
- mysql_extra_config for my.cnf HOT 2
- force mariadb installation on ubuntu 22.04 not working HOT 1
- mysql_bind_address does not override all conf files
- FAILED! => {"changed": false, "msg": "Could not find the requested service mysql: host"} HOT 5
- secure-installation fails on RHEL8 at remove test database. HOT 3
- includedir is set only if mysql_config_include_files is set HOT 2
- error "couldn't resolve module/action 'mysql_user'" when i used in awx HOT 4
- add innodb settings HOT 2
- Warning "Option column_case_sensitive is not provided" during MySQL user setup HOT 2
- 'sudo mysql' allows access w/o password authentication after fresh install HOT 1
- root password with $ or %
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-role-mysql.