Ask Your Question

How to resolve Can't connect to MySQL server on a particular host name in configuring the keystone?

asked 2014-01-31 10:51:11 -0500

ebyenjoys gravatar image

Hello Guys,

I am trying to configure keystone for my swift and i am following this link

As per the second step i have changed my hostname to controller and edited /etc/keystone/keystone.conf and changed the [sql] section as follows.

# The SQLAlchemy connection string used to connect to the database
connection = mysql://keystone:xxxxxxx@controller/keystone

Also as per the third step i have deleted keystone.db in /var/lib/keystone/ directory.

and in the fourth step my changes are as follows:

# mysql -u root -p
mysql> CREATE DATABASE keystone;
mysql> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'controller' \
IDENTIFIED BY 'xxxxxxx';
mysql> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' \
IDENTIFIED BY 'xxxxxxx';

After this,when i tried to run # keystone-manage db_sync i am getting the following error:

2014-01-31 22:00:43.789 1966 CRITICAL keystone [-] (OperationalError) (2003, "Can't connect to MySQL server on      'controller' (111)") None None

Could anyone sort it out the source of this issue?

edit retag flag offensive close merge delete


did you change the bind address in my.conf to controller ? Also whether controller is resolvable i.e /etc/hosts has it ?

dheeru gravatar imagedheeru ( 2014-01-31 11:50:02 -0500 )edit

The following changes in /etc/hosts worked for me, Thanks. controller controller But would it make any trouble if i make connections to sql remotely?

ebyenjoys gravatar imageebyenjoys ( 2014-01-31 22:55:44 -0500 )edit

you will not be able to make remote connection.

dheeru gravatar imagedheeru ( 2014-02-01 10:51:33 -0500 )edit

What should i do to get remote connection?

ebyenjoys gravatar imageebyenjoys ( 2014-02-03 05:36:32 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2014-01-31 12:22:58 -0500

sgordon gravatar image

Ensure that the hostname resolves, you have also run the FLUSH PRIVILEGES command in MySQL (or restarted MySQL) and that port 3306 is open to connections from controller in the system firewall.

edit flag offensive delete link more


Thanks, when i changed as controller,it worked.

ebyenjoys gravatar imageebyenjoys ( 2014-01-31 22:59:59 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2014-01-31 10:51:11 -0500

Seen: 17,941 times

Last updated: Jan 31 '14