Ask Your Question

devstack install fails with mysql connection refused

asked 2017-03-20 11:37:37 -0500

karntol gravatar image

updated 2017-03-20 16:08:31 -0500


I am banging my head on this problem.

I am following this process on an utterly clean Ubuntu xenial VM. I have created a vagrant machine.

Then I followed this process to install everything on the VM: (

I have added an extra line in the local.conf:


The error while running is this:

+lib/databases/mysql:recreate_database_mysql:56  local db=glance
+lib/databases/mysql:recreate_database_mysql:57  mysql -uroot -psecret -h127.0.0.1 -e 'DROP DATABASE IF EXISTS glance;'
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2003 (HY000): Can't connect to MySQL server on '' (111)
+lib/databases/mysql:recreate_database_mysql:1  exit_trap
+./                  local r=1
++./                  jobs -p
+./                  jobs=
+./                  [[ -n '' ]]
+./                  kill_spinner
+./               '[' '!' -z '' ']'
+./                  [[ 1 -ne 0 ]]
+./                  echo 'Error on exit'
Error on exit
+./                  generate-subunit 1490014762 1437 fail
+./                  [[ -z /opt/stack/logs ]]
+./                  /home/stack/devstack/tools/ -d /opt/stack/logs
World dumping... see /opt/stack/logs/worlddump-2017-03-20-132319.txt for details
+./                  exit 1

When I lookup that function recreate_database_mysql , line 57, I see two mysql calls in there. When I run them by hand, they run fine.

I was about to learn openstack but I can't continue for the last two days and this is really irritating.


stack@ubuntu-xenial:~/devstack$ cat local.conf 


manually it works fine:

stack@ubuntu-xenial:~/devstack$ mysql -uroot -psecret -h127.0.0.1 -e 'show databases'
mysql: [Warning] Using a password on the command line interface can be insecure.
| Database           |
| information_schema |
| keystone           |
| mysql              |
| performance_schema |
| sys                |
edit retag flag offensive close merge delete


can someone help out here, I am really waiting for it and I can't continue.. :(

karntol gravatar imagekarntol ( 2017-03-20 15:18:30 -0500 )edit

So installed mysql manually?

Karthik Prasad gravatar imageKarthik Prasad ( 2017-03-21 05:46:07 -0500 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2017-03-20 21:18:21 -0500

tcpip gravatar image


did you create the stack user?


edit flag offensive delete link more


Yes. The prompt shows this stack user

karntol gravatar imagekarntol ( 2017-03-21 01:20:14 -0500 )edit

answered 2017-03-21 06:35:29 -0500

vgeorga gravatar image

Well, if it's not the first time you're trying to install DevStack, ./ doesn't remove MySQl data and that sometimes can't result to errors during re-installations.

I would suggest trying:

1) ./ 2) ./ 3) ./

The script will remove all packages installed by ./ during previous installations so your next installation will begin from scratch (re-download packages, re-install etc)

Or just manually remove MySQL and all it's dependencies before running ./ again.

Hope this helps.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2017-03-20 11:37:37 -0500

Seen: 1,262 times

Last updated: Mar 21 '17