"ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)"
Issue Type
- Bug Report / Support Request
Your Environment
Vagrant 1.9.1
VirtualBox 5.1.10+
Ansible 2.2.0
Your OS
- Mac OS Sierra 10.12.2
Full console output
[DEPRECATION WARNING]: always_run is deprecated. Use check_mode = no instead..
This feature will be removed in version 2.4. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. fatal: [visisnowdonia]: FAILED! => {"changed": false, "cmd": ["mysql", "-NBe", "SELECT Host FROM mysql.user WHERE User = """], "delta": "0:00:00.004292", "end": "2016-12-16 10:27:55.073310", "failed": true, "rc": 1, "start": "2016-12-16 10:27:55.069018", "stderr": "ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)", "stdout": "", "stdout_lines": [], "warnings": []}
Summary
I have tried to use Drupal-VM 4.0.0 and 3.5.2. But, can't get pass the above error. It is working fine in my old machine with ansible 2.1.0. Please advise. I got complete stuck.
@kshamsuddin - Can you diff your config.yml with the default configuration file so I can see what you might have configured differently from the defaults?
Also, have you done a vagrant destroy then rebuilt the VM with vagrant up?
See related: https://github.com/geerlingguy/ansible-role-mysql/issues/57
Hi, I have destroyed the box several times. But, no luck.
Below is the diff of my config.yml against default.config.yml [Drupal-VM 4.0.0]
10,12c10,12
< vagrant_hostname: bdeshi.local
< vagrant_machine_name: bdeshi
< vagrant_ip: 192.168.100.100
---
> vagrant_hostname: drupalvm.dev
> vagrant_machine_name: drupalvm
> vagrant_ip: 192.168.88.88
26,27c26,27
< - local_path: ./../..
< destination: /vagrant
---
> - local_path: .
> destination: /var/www/drupalvm
32,33c32,40
< vagrant_memory: 1024
< vagrant_cpus: 2
---
> vagrant_memory: 2048
> vagrant_cpus: 1
>
> # Minimum required versions.
> drupalvm_vagrant_version_min: '1.8.6'
> drupalvm_ansible_version_min: '2.2'
>
> # Force use of ansible_local provisioner, even if Ansible is installed on host.
> force_ansible_local: false
36c43,46
< drupalvm_webserver: nginx
---
> drupalvm_webserver: apache
>
> # The database system to use. Can be either 'mysql' or 'pgsql'.
> drupalvm_database: mysql
41a52
> drush_make_options: "--no-gitinfofile"
45,48c56,60
< build_composer: true
< drupal_composer_path: false
< drupal_composer_install_dir: "/vagrant"
< drupal_composer_dependencies: []
---
> build_composer: false
> drupal_composer_path: "{{ config_dir }}/drupal.composer.json"
> drupal_composer_install_dir: "/var/www/drupalvm/drupal"
> drupal_composer_dependencies:
> - "drupal/devel:1.x-dev"
52c64
< build_composer_project: false
---
> build_composer_project: true
58c70
< install_site: false
---
> install_site: true
62,64c74,76
< drupal_mysql_user: bdeshi_development
< drupal_mysql_password: bdeshi_development
< drupal_mysql_database: bdeshi_development
---
> drupal_db_user: drupal
> drupal_db_password: drupal
> drupal_db_name: drupal
69c81
< drupal_site_name: "Bdeshi"
---
> drupal_site_name: "Drupal"
71c83
< drupal_enable_modules: []
---
> drupal_enable_modules: [ 'devel' ]
81,83c93,94
< # - {
< # name: "Drupal Cron",
< # minute: "*/30",
---
> # - name: "Drupal Cron"
> # minute: "*/30"
85d95
< # }
157,158c167
< # MySQL Databases and users. If 'install_site' is 'true', first database will
< # be used for the site.
---
> # MySQL databases and users.
160,162c169,171
< - name: "{{ drupal_mysql_database }}"
< encoding: utf8
< collation: utf8_general_ci
---
> - name: "{{ drupal_db_name }}"
> encoding: utf8mb4
> collation: utf8mb4_general_ci
165c174
< - name: "{{ drupal_mysql_user }}"
---
> - name: "{{ drupal_db_user }}"
167,168c176,187
< password: "{{ drupal_mysql_password }}"
< priv: "{{ drupal_mysql_database }}.*:ALL"
---
> password: "{{ drupal_db_password }}"
> priv: "{{ drupal_db_name }}.*:ALL"
>
> # PostgreSQL databases and users.
> postgresql_databases:
> - name: "{{ drupal_db_name }}"
>
> postgresql_users:
> - name: "{{ drupal_db_user }}"
> password: "{{ drupal_db_password }}"
> db: "{{ drupal_db_name }}"
> priv: "ALL"
171c190
< # to install *any* extras, make set this value to an empty set, e.g. `[]`.
---
> # to install *any* extras, set this value to an empty set, e.g. `[]`.
175c194,197
< # - drupalconsole
---
> - drupalconsole
> - drush
> # - elasticsearch
> # - java
177c199
< - memcached
---
> # - memcached
179c201
< - nodejs
---
> # - nodejs
182c204
< - ruby
---
> # - ruby
184c206,207
< - solr
---
> # - solr
> # - upload-progress
186c209
< - xdebug
---
> # - xdebug
191c214
< - ant
---
> - sqlite
196c219
< drush_version: "master"
---
> drush_version: "8.x"
210a234
> - "9200"
213,214c237,238
< # PHP Configuration. Currently-supported versions: 5.6, 7.0.
< # To use 5.6, see: http://docs.drupalvm.com/en/latest/other/php-56/
---
> # PHP Configuration. Currently-supported versions: 5.6, 7.0, 7.1.
> # See version-specific notes: http://docs.drupalvm.com/en/latest/other/php/
215a240
> php_install_recommends: no
220c245
< php_sendmail_path: "/usr/sbin/ssmtp -t"
---
> php_sendmail_path: "/opt/mailhog/mhsendmail"
242,244c267,268
< post_provision_scripts:
< - "{{ config_dir }}/solr.sh"
< - "{{ config_dir }}/add_sass_to_path.sh"
---
> post_provision_scripts: []
> # - "../examples/scripts/configure-solr.sh"
247c271
< mysql_root_password: 199*^JJNJuK/FISH<H)££@2POO
---
> mysql_root_password: root
262c286
< ruby_install_gems: [ sass ]
---
> ruby_install_gems: []
285c309
< solr_version: "5.5.1"
---
> solr_version: "5.5.3"
290c314
< selenium_version: 2.46.0
---
> selenium_version: 2.53.0
295c319
< #ssh_home: "{{ drupal_core_path }}"
---
> #ssh_home: "{{ drupal_core_path }}"
\ No newline at end of file
@kshamsuddin - Did you figure out the issue? (Or should we keep this issue open)
Sorry, I haven't figured it out yet.
Hi @geerlingguy - Do you have any more advise to resolve this?
I noticed @geerlingguy updated the MySQL ansible role a few days ago. Maybe worth trying the master branch of Drupal VM to see if whatever was updated fixes your problem. https://github.com/geerlingguy/drupal-vm/commit/a247ddbcbfad8f40a7db96ec262f10793812fd6a
@kshamsuddin have you tried this again with a newer version of Drupal VM?
Hi @oxyc, Yes, I tried with Drupal VM 4.1.1 and didn't have that problem any more. Thanks.
Great! Lets assume one of the mysql role updates fixed it then.
I think this issue is back. I can connect to the db fine via SSH through sequel pro but can't connect via command line and cannot connect perform any operations once inside Sequel Pro.
Sequel Pro error:
MySQL said: Access denied for user 'drupal'@'%' to database 'test'
This is on an install of DrupalVM 4.2 this morning. Fresh Virtual Box, Ansible and Vagrant installs as well. I tried to check privileges to see if that would point me anywhere and got:
ERROR 1142 (42000): SELECT command denied to user 'drupal'@'localhost' for table 'sql_show_grants'
mysql>```
@brs14ku - So are you saying that in Sequel Pro, you can open the connection but then can't see tables, or edit a row, or something like that?
Also, is your config like this?
