1. After the successful installation of MARIADB database on Linux, whether it is in DOS (TAP command mysql-h192.168.136.8-uroot-p) or navicat (create connection) under the MARIADB database, will be an error:
Can ' t get hostname to your address
2. Under the Vim/etc/my.cnf file, add
[Mysqld]
Skip-name-resolve
Explanation: The reason why the MARIADB database is not connected is because MySQL has a DNS reverse resolution of the connected client.
There are 2 ways to ① the problem:
The first: The client's IP written in the MySQL server/etc/hosts file, just give a name on it.
The second type: Add –skip-name-resolve to the MY.CNF.
For the first method is more stupid and not practical, then the SKIP-NAME-RESOLVE option can disable DNS resolution, but, this can not use the hostname in the MySQL authorization table, only use IP.
② I understand that MySQL is the way to handle the client parsing process,
When MySQL client is connected, the server proactively checks the client's domain name.
First find the/etc/hosts file, search for the corresponding relationship between domain name and IP.
If the Hosts file does not, look for DNS settings, if the DNS server is not set, will return to failure immediately, equivalent to MySQL set the Skip-name-resolve parameter, if the DNS server is set,
The reverse parsing until the timeout.
③ the so-called reverse parsing is this:
When MySQL receives the connection request, it obtains the IP of the client, in order to better match the permission record in the Mysql.user (some are defined by hostname).
If the MySQL server has a DNS server set up and the client IP does not have a corresponding hostname on DNS, the process is slow, causing the connection to wait.
After adding skip-name-resolve, I skipped a process.
3. In general, it should be possible to connect to the MARIADB database. If the above scenario is still not possible, then the permissions for your data may not be assigned, execute the following command:
Log on to the Linux mariadb database, use mysql-uroot-p//So you should be able to access the MySQL server
Mysql>grant all privileges in *.* to ' root ' @ '% ' with GRANT OPTION//give any host access to data
Mysql>flush Privileges//amendment effective
Mysql>exit//exit MySQL server