keystone 無法導入解決方法

su -s /bin/sh -c “keystone-manage db_sync” keystone 無法導入解決方法
其中出現以下兩個問題:
SQL connection failed. 9 attempts left.: DBConnectionError: (pymysql.err.OperationalError) (2003, “Can’t connect to MySQL server on ‘allone’ ([Errno 111] Connection refused)”)
ERROR keystone DBError: (pymysql.err.InternalError) (1071, u’Specified key was too long; max key length is 767 bytes’) [SQL: u’\nCREATE TABLE migrate_version (\n\trepository_id VARCHAR(250) NOT NULL, \n\trepository_path TEXT, \n\tversion INTEGER, \n\tPRIMARY KEY (repository_id)\n)\n\n’]
我的keystone配置文件沒有錯誤:/etc/keystone/keystone.conf
如:[database]
connection = mysql+pymysql://keystone:password@allone/keystone
解決方法:編輯該文件 :vi /etc/mysql/mariadb.conf.d/50-server.cnf
bind-address 192.168.104.10 ##改成主機名(我的是allone)所對應的IP地址
character-set-server = utf8 ##字符集改成這樣
collation-server = utf8_general_ci
改完後刪除keystone數據庫
刪除用戶及授權
如:drop ‘keystone’@’localhost’;
drop ‘keystone’@’%’;
重啓mysql
重建數據庫和重新授權
su -s /bin/sh -c “keystone-manage db_sync” keystone
查看/var/log/keystone/keystone-manage.log是否導入,查看數據庫keystone有表,成功
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章