Ask Your Question
1

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 http://docs.openstack.org/havana/install-guide/install/apt/content/keystone-install.html

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.

[sql]
# 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

Comments

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. 127.0.0.1 controller 127.0.1.1 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
1

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

Comments

Thanks, when i changed 127.0.0.1 as controller,it worked.

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

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

Seen: 15,980 times

Last updated: Jan 31 '14