In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to connect navicat to ubuntu's mysql, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
1. The configuration file for mysql is in / etc/mysql/my.cnf, as shown in the following figure. The configuration file is rich, and we can see the user of mysql, the listening port number, the data file storage directory, and so on.
2. Use the cat command to view the contents of my.cnf. As shown in the following figure, in the my.cnf configuration file, the default IP for bind-address is 127.0.0.1, which means that connections are limited to native IP. If mysql is not configured, it is not possible to connect to the database using Navicat or other remote connection tools.
3. In order for other IP outside to access it normally, you need to set the IP corresponding to bind-address to 0.0.0.0. Use vi or vim to edit the my.cnf configuration file. After the configuration is complete, as shown in the following figure:
4. After changing the configuration file my.cnf, you need to restart mysql. Enter the command: sudo service mysql restart, as shown in the following figure:
Enter the process view command, and you can see that the mysqld process already exists, indicating that mysql started successfully.
5. Next, connect to the database remotely through Navicat. View the IP through ifconfig. You can see that the IP address is 192.168.255.131.
6. Open Navicat, and then click New connection, as shown below:
7. Click "connection Test" to pop up the interface below. Indicates that the connection test failed because we have not authorized the mysql remote connection yet. The permission problem of Mysql is very strict, even though we have opened the IP address, we have not authorized the root user because the connection still failed. In other words, after we authorize the root user, we will be able to access the database normally if the IP address is not 127.0.0.1. If it is not set, the default is that external localhost connections are invalid except local IP connections that can be accepted in the past. Although their IP is bound on 0.0.0.0, they still don't have permission.
8. Next, let's move on to mysql in Ubuntu.
9. Enter the remote authorization command. The syntax template is as follows: grant all privileges on library name. Table name to 'username' @'IP address' identified by 'password' with grant option
Here, according to his own situation, the editor enters the command on the Ubuntu command line: grant all privileges on *. * to 'root'@'%' identified by '123456' with grant option
*. * is a regular expression that represents authorization for all tables; root for root users; and% for all external IP;123456 represents passwords.
As shown in the following figure:
10. After authorization, enter the command: "flush privileges;" to refresh permissions, as shown in the figure above. You can then exit the mysql database.
11. At this point, go to Navicat and try the connection test again, as shown in the following figure. You can see that the test connection is successful.
12. Click OK, and then you can see that the database with IP address 192.168.255.131 is already in Navicat on the main page of Navicat.
13. Double-click on the left side of the 192.168.255.131 database, you can see the database information. You can then remotely manipulate the database in Navicat, synchronizing with the database in Ubuntu.
The above is all the content of the article "how navicat connects to ubuntu's mysql". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.