Tag Archives: OpenStack Error

[Solved] OpenStack Error: MariaDB ERROR 2002 (HY000): Can’t connect to MySQL server on ‘controller’ (115)

 

Solution:

vi /etc/my.cnf.d/openstack.cnf      # If you don't have this, fix my.cnf or Baidu 'Centos modify MariaDB configuration file'
Comment out the original assignment of bind-address
and change it to
bind-address=0.0.0.0

 

 

 

 

Resolution process backtracking

 

There are old problems when deploying t version keystone. The troubleshooting process is as follows

PS: dual node, hostname – > controller -> 10.0.0.11

1.Troubleshoot MySQL command access rights
    a. mysql -h localhost -u<db_name> -p<db_pass> -e 'show databases;'
    b. mysql -h controller -u<db_name> -p<db_pass> -e 'show databases;'
    c. mysql -h 192.168.75.128 -u<db_name> -p<db_pass> -e 'show databases;'
    d. mysql -h 10.0.0.11 -u<db_name> -p<db_pass> -e 'show databases;'

    Result: b, d not pass

2. troubleshoot Mysql table
    MariaDB [(none)]> select host,user from mysql.user;     # Grant localhost & %
    Add:
    MariaDB [(none)]> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'controller' IDENTIFIED BY 'keystone';
    MariaDB [(none)]> flush privileges;

    Result: No (This method solved some problems when deploying R version)

3. troubleshoot the Mysql configuration file
    vi /etc/my.cnf.d/openstack.cnf
    bind-address=192.168.75.128 change to bind-address=0.0.0.0

    Outcome: ok