Ask Your Question
0

SQL access denied which nova-manage db sync

asked 2011-05-20 05:35:22 -0500

fred-yang gravatar image

I am installing nova from source code on ubuntu 10.10. If following $ mysql -uroot -ppassword

CREATE DATABASE nova; GRANT ALL PRIVILEGES ON . TO 'root'@'%' WITH GRANT OPTION; SET PASSWORD FOR 'root'@'%' = PASSWORD('nova'); to grant password to nova, and specify "--sql_connection=mysql://root:nova@192.168.0.13/nova" in bin/nova.conf, then I will get Access denied while running nova-manage db sync.

But if I change to 'root'@localhost in Mysql and root://root:nova@localhost/nova in conf, then db sync works fine. It seems no others has this issue, can you share your fixes? Thanks, -Fred

Error log attached

2011-05-19 22:22:08,200 DEBUG migrate.versioning.util [-] Disposing SQLAlchemy engine Engine(mysql://root:nova@192.168.0.13/nova) from (pid=2269) with_engine /usr/lib/pymodules/python2.6/migrate/versioning/util/__init__.py:163 Command failed, please check log for more info 2011-05-19 22:22:08,205 CRITICAL nova [-] (OperationalError) (1045, "Access denied for user 'root'@'story' (using password: YES)") None None (nova): TRACE: Traceback (most recent call last): (nova): TRACE: File "./bin/nova-manage", line 1142, in <module> (nova): TRACE: main() (nova): TRACE: File "./bin/nova-manage", line 1131, in main (nova): TRACE: fn(argv) (nova): TRACE: File "./bin/nova-manage", line 755, in sync (nova): TRACE: return migration.db_sync(version) (nova): TRACE: File "/home/fred/o1/nova/nova/db/migration.py", line 35, in db_sync (nova): TRACE: return IMPL.db_sync(version=version) (nova): TRACE: File "/home/fred/o1/nova/nova/db/sqlalchemy/migration.py", line 41, in db_sync (nova): TRACE: db_version() (nova): TRACE: File "/home/fred/o1/nova/nova/db/sqlalchemy/migration.py", line 56, in db_version (nova): TRACE: meta.reflect(bind=engine) (nova): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/schema.py", line 1925, in reflect (nova): TRACE: conn = bind.contextual_connect() (nova): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/base.py", line 1742, in contextual_connect (nova): TRACE: self.pool.connect(), (nova): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/pool.py", line 158, in connect (nova): TRACE: return _ConnectionFairy(self).checkout() (nova): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/pool.py", line 329, in __init__ (nova): TRACE: rec = self._connection_record = pool.get() (nova): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/pool.py", line 177, in get (nova): TRACE: return self.do_get() (nova): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/pool.py", line 692, in do_get (nova): TRACE: con = self.create_connection() (nova): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/pool.py", line 138, in create_connection (nova): TRACE: return _ConnectionRecord(self) (nova): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/pool.py", line 213, in __init__ (nova): TRACE: self.connection = self.__connect() (nova): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/pool.py", line 279, in __connect (nova): TRACE: connection = self.__pool._creator() (nova): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/strategies.py", line 76, in connect (nova): TRACE: return dialect.connect(cargs, *cparams) (nova): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/default.py", line ... (more)

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
0

answered 2011-05-20 06:05:43 -0500

vishvananda gravatar image

You probably have an entry for root@'story' in your user records. I've had bad luck using SET PASSWORD, it doesn't always seem to change all of the user records. Try an update instead:

mysql> UPDATE mysql.user SET Password=PASSWORD('MyNewPass') -> WHERE User='root'; mysql> FLUSH PRIVILEGES;

Vish

On May 19, 2011, at 10:35 PM, fred yang wrote:

New question #158294 on OpenStack Compute (nova): https://answers.launchpad.net/nova/+q...

I am installing nova from source code on ubuntu 10.10. If following $ mysql -uroot -ppassword

CREATE DATABASE nova; GRANT ALL PRIVILEGES ON . TO 'root'@'%' WITH GRANT OPTION; SET PASSWORD FOR 'root'@'%' = PASSWORD('nova'); to grant password to nova, and specify "--sql_connection=mysql://root:nova@192.168.0.13/nova" in bin/nova.conf, then I will get Access denied while running nova-manage db sync.

But if I change to 'root'@localhost in Mysql and root://root:nova@localhost/nova in conf, then db sync works fine. It seems no others has this issue, can you share your fixes? Thanks, -Fred

Error log attached

2011-05-19 22:22:08,200 DEBUG migrate.versioning.util [-] Disposing SQLAlchemy engine Engine(mysql://root:nova@192.168.0.13/nova) from (pid=2269) with_engine /usr/lib/pymodules/python2.6/migrate/versioning/util/__init__.py:163 Command failed, please check log for more info 2011-05-19 22:22:08,205 CRITICAL nova [-] (OperationalError) (1045, "Access denied for user 'root'@'story' (using password: YES)") None None (nova): TRACE: Traceback (most recent call last): (nova): TRACE: File "./bin/nova-manage", line 1142, in <module> (nova): TRACE: main() (nova): TRACE: File "./bin/nova-manage", line 1131, in main (nova): TRACE: fn(argv) (nova): TRACE: File "./bin/nova-manage", line 755, in sync (nova): TRACE: return migration.db_sync(version) (nova): TRACE: File "/home/fred/o1/nova/nova/db/migration.py", line 35, in db_sync (nova): TRACE: return IMPL.db_sync(version=version) (nova): TRACE: File "/home/fred/o1/nova/nova/db/sqlalchemy/migration.py", line 41, in db_sync (nova): TRACE: db_version() (nova): TRACE: File "/home/fred/o1/nova/nova/db/sqlalchemy/migration.py", line 56, in db_version (nova): TRACE: meta.reflect(bind=engine) (nova): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/schema.py", line 1925, in reflect (nova): TRACE: conn = bind.contextual_connect() (nova): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/base.py", line 1742, in contextual_connect (nova): TRACE: self.pool.connect(), (nova): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/pool.py", line 158, in connect (nova): TRACE: return _ConnectionFairy(self).checkout() (nova): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/pool.py", line 329, in __init__ (nova): TRACE: rec = self._connection_record = pool.get() (nova): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/pool.py", line 177, in get (nova): TRACE: return self.do_get() (nova): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/pool.py", line 692, in do_get (nova): TRACE: con = self.create_connection() (nova): TRACE: File "/usr/lib/python2.6/dist-packages/sqlalchemy/pool.py", line 138, in create_connection (nova): TRACE: return _ConnectionRecord(self) (nova): TRACE: File ...

(more)
edit flag offensive delete link more
0

answered 2011-05-20 07:50:30 -0500

guanxiaohua2k6 gravatar image

Execute the following command before do nova-mange db sync.

sudo sed -i "s/127.0.0.1/0.0.0.0/g" /etc/mysql/my.cnf

edit flag offensive delete link more
0

answered 2011-05-20 15:07:58 -0500

fred-yang gravatar image

Thanks Vish Ishaya, that solved my question.

edit flag offensive delete link more

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: 2011-05-20 05:35:22 -0500

Seen: 153 times

Last updated: May 20 '11