Windows to access the MARIADB database under Linux using Navicat

Source: Internet
Author: User
Tags mysql client

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

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.