Ask Your Question

How to change default database in keystone?

asked 2014-07-04 03:02:19 -0500

anhdenday gravatar image

Dear All, As I see from testcase command for testing the next migration in sequence (both forward & backward) in a database under version control: "python keystone/common/sql/migrate_repo/ test \ --url=sqlite:///test.db \ --repository=keystone/common/sql/migrate_repo/" The default DB in keystone is sqlite, I want to change default DB to MySQL. How can I do? I also find in keystone.conf file. But I dont know where and how to change! Please help me!

Thanks you so much

edit retag flag offensive close merge delete


It should be "[database] connection=xxxxxxxxx? ", isn't it?

Strangely, mysql is used in my environment, while such entry is actually commented.

sunzen gravatar imagesunzen ( 2014-07-04 03:44:29 -0500 )edit

Yes, Maybe you install from DevStack, but in my case, I deploy keystone from keystone source code. I dont know it deference or not?

anhdenday gravatar imageanhdenday ( 2014-07-04 04:22:15 -0500 )edit

I use the following command: "cat etc/keystone.conf | grep mysql", the result is that: #mysql_sql_mode=TRADITIONAL So there is one line that have mysql is: "mysql_sql_mode=TRADITIONAL" but it is commented. I continue to check sqlite in keystone.conf file so that i see it also commented. #sqlite_db=keystone.sqlite #sqlite_synchronous=true But sqlite is default DB? Why do i change to mysql db? Can you please explain more? Thanks

anhdenday gravatar imageanhdenday ( 2014-07-04 04:28:48 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2014-07-04 04:45:03 -0500

foexle gravatar image

Hi Anhdenday,

open your keystone.conf find sql section and change your connection settings like this

# The SQLAlchemy connection string used to connect to the database
connection = mysql://user:pw@

Change IP to you database and 'keystone' as your db name.

Cheers Heiko

edit flag offensive delete link more


It's work, thanks you so much Heiko I have one more question, I try to compare with keystone configuration whenever i installed devstack (I already installed openstack by DevStack) I found in the folder "/opt/stack/keystone/etc" so that I did not see the file keystone.conf, still have "keystone.conf.sample". But actually it's work with MySQL, so that where did they config mysql for all service(include keystone)? Thanks you so much

anhdenday gravatar imageanhdenday ( 2014-07-07 01:57:32 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2014-07-04 03:02:19 -0500

Seen: 2,187 times

Last updated: Jul 04 '14