Giter Club home page Giter Club logo

Comments (13)

nestormata avatar nestormata commented on May 27, 2024

I have the exact same issue.
Were you able to solve it?

Thanks

from ansible-role-mysql.

chuwy avatar chuwy commented on May 27, 2024

@nestormata as I said I've changed remote_user to root and that task had completed.

from ansible-role-mysql.

geerlingguy avatar geerlingguy commented on May 27, 2024

This would also be fixed by the changes listed in #36, but since that issue won't be able to be fixed for at least a few weeks, I would like to update the documentation to make this requirement a more explicit.

Another option, btw, would be to set mysql_user_home to /home/vagrant. That may work.

from ansible-role-mysql.

geerlingguy avatar geerlingguy commented on May 27, 2024

Adding postponed label; will wait until a little time after Ansible 2.0.0 is released.

from ansible-role-mysql.

sagikazarmark avatar sagikazarmark commented on May 27, 2024

@geerlingguy no, it does not work, I've just tried. The problem is the .my.cnf file is owned by root with 600 permissions. I wonder why that file can't be read though, hence sudo: yes is used.

from ansible-role-mysql.

sagikazarmark avatar sagikazarmark commented on May 27, 2024

@chuwy that's not an option either, you cannot connect to a vagrant box with root user.

from ansible-role-mysql.

sagikazarmark avatar sagikazarmark commented on May 27, 2024

I found a temporary workaround. Add this to your playbook (and leave mysql_user_home default value (root)):

become_method: su

You can also add this post_task to copy the .my.cnf to the vagrant home directory for future usage:

  post_tasks:
    - stat: path=/root/.my.cnf
      register: mysql_config_exists
    - shell: cp /root/.my.cnf /home/vagrant/.my.cnf && chown vagrant. /home/vagrant/.my.cnf
      when: mysql_config_exists.stat.exists

from ansible-role-mysql.

geerlingguy avatar geerlingguy commented on May 27, 2024

@sagikazarmark - Interestingly, the role works fine with Drupal VM and is able to mange the file without any issues. I wonder if there's something else about the configuration/setup of the Vagrant box(es) being used that's causing a problem.

from ansible-role-mysql.

sagikazarmark avatar sagikazarmark commented on May 27, 2024

I doubt it, it's a plain ubuntu box:

Vagrant.configure(2) do |config|

  config.vm.box = "ubuntu/trusty64"

  config.vm.synced_folder ".", "/vagrant", id: "application"

  config.vm.provision "ansible" do |ansible|
    ansible.playbook = ".ansible/playbook.yml"
  end
end

Even if it is platform specific thing, user should be able to install the file in whatever user, not just with root as owner.

from ansible-role-mysql.

sagikazarmark avatar sagikazarmark commented on May 27, 2024

The file is placed at the given user home (/home/vagrant), but the user cannot read it (hence the root privileges). Even if it works in some environments, I still think the file should be placed with a proper owner. (Into ssh user's home, and ssh user as owner by default)

from ansible-role-mysql.

dixhuit avatar dixhuit commented on May 27, 2024

Setting remote_user = root in ansible.cfg makes no difference for me when provisioning Ubuntu 14.04.4 x64 on DigitalOcean.

from ansible-role-mysql.

niccolox avatar niccolox commented on May 27, 2024

I am getting this error in Travis and NOT in Vagrant

lots of attempts at fixes also

TASK [geerlingguy.mysql : Get list of hosts for the anonymous user.] ***********
fatal: [localhost]: FAILED! => {"changed": false, "cmd": ["mysql", "-NBe", "SELECT Host FROM mysql.user WHERE User = """], "delta": "0:00:00.007884", "end": "2016-05-03 06:55:22.457248", "failed": true, "rc": 1, "start": "2016-05-03 06:55:22.449364", "stderr": "ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)", "stdout": "", "stdout_lines": [], "warnings": []}

from ansible-role-mysql.

lxcodes avatar lxcodes commented on May 27, 2024

I'm actually still having issues with this on my Ubuntu 14.04 hosts at the same spot as @niccolox. Looks like the mysql-client is just ignoring the /root/.my.cnf file even if I ssh into the server itself as root.

Update:
Must not have installed the latest master (6 days ago) though as I noticed password wasn't in quotes in .my.cnf. Solves the issue for us.

from ansible-role-mysql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.