MySQL licensing localhost&% differences and always-on authorization error resolution (Installation of OpenStack thoughts)

Source: Internet
Author: User

The first is to attach the OpenStack document, as an example to explain why the right to the% but has been reported permission error!
mysql-u Root-pyunjisuan
CREATE DATABASE Keystone;

GRANT all privileges the keystone.* to ' keystone ' @ ' localhost ' identified by 'Keystone_dbpass';

GRANT all privileges the keystone.* to ' Keystone ' @ '% ' identified by 'Keystone_dbpass';


correct understanding, here the use of% is representative of all the host can access the MySQL remotely. However, the official MySQL document has been queried to indicate that% does not include localhost. Thus, both localhost and% have been empowered to do so.
Next, look at the Hosts file:vim/etc/hosts
Configure the Keystone.conf file:
To view the Keystone log:Tailf/var/log/keystone/keystone.log
To execute a Synchronous database command:

Su-s/bin/sh-c "Keystone-manage Db_sync" Keystone



The log has an incorrect permission error for the head:


This error estimate has plagued many people who have installed OpenStack, at least from the OpenStack e version to now the Juno version, often reporting this nonsense error,Obviously this one sees is the authority error, generally I will adopt the direct Keystone. conf connection = Mysql://keystone:keystone_dbpass@controller/ Keystone configured to

Connection = Mysql://keystone:keystone_dbpass@192.168.38.100/keystone can be resolved. But in fact we authorize% should be all host should be able to access only right. So where does the problem go?



by querying the MySQL official website is said to be configured% so that all other host access has permissions, you can say the above error is to tell me, no permissions. here to say, the configuration of the% remote other host has access, then in the MySQL configuration file/etc/my.cnf, also need to do some configuration, will bind_address=0.0.0.0 or directly block out this, more please find the data yourself.

continue to come back how to solve the above error problem, go back and look at the/etc/hosts file:
The controller node is clearly configured, try to move the item to a location, a miracle appears:
then add the controller after the above 127.0.0.1 localhost. As for the 127.0.0.1 localhost this line of data represents what meaning, Baidu asked to go. Just say that the controller is the alias of localhost.
Continue execution command: su-s/bin/sh-c "Keystone-manage db_sync" Keystone

To view logs:

found success. In fact, the controller here is the alias of localhost, because before the authorization of localhost, so the controller is authorized. But the first type of/etc/hosts is just the DNS function, so reporting permissions error.
Pit: This problem, troubled for several years, recently installed Juno version when there are errors, vowed to solve, spent two days of various Google, Baidu finally resolved. (Forgive my small perfect paranoid syndrome, not to solve the psychological discomfort, even if can evade also is uncomfortable, but finally solved, give yourself praise one. )

MySQL licensing localhost&% differences and always-on authorization error resolution (Installation of OpenStack thoughts)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.