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



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





Resolution process backtracking


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

PS: dual node, hostname – > controller ->

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 -u<db_name> -p<db_pass> -e 'show databases;'
    d. mysql -h -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 & %
    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= change to bind-address=

    Outcome: ok

Similar Posts: