1. The mysql configuration file is in /etc/mysql/my.cnf, as shown in the figure below. The content in the configuration file is very rich. We can see the mysql user, listening port number, data file storage directory, etc.
#2. Use the cat command to view the contents of my.cnf. As shown in the figure below, in the my.cnf configuration file, the default IP of bind-address is 127.0.0.1, which means that connections are limited to the local IP. If mysql is not configured, Navicat or other remote connection tools cannot be used to connect to the database.
#3. In order to allow other external IPs to access it normally, the IP corresponding to bind-address needs to be set to 0.0.0.0. Use vi or vim to edit the my.cnf configuration file. After the configuration is completed, as shown in the following figure:
4. After changing the configuration file my.cnf, you need to modify mysql To restart, enter the command: sudo service mysql restart, as shown in the following figure:
Enter the process view command. You can see that the mysqld process already exists, indicating that mysql has started successfully.
5. Next, connect to the database remotely through Navicat. Check the IP through ifconfig. You can see that the IP address is 192.168.255.131.
Related recommendations: "Navicat for mysql graphic tutorial"
6. Open Navicat, and then click New Connection, as follows As shown in the picture:
#7. Click "Connection Test" and the following interface will pop up. It means that the connection test failed because we have not yet authorized the mysql remote connection. The permission issue of Mysql is very strict. Even though we have opened the IP address, we have not yet authorized the root user because the connection still fails. In other words, after we authorize the root user, we will be able to access the database normally even if the IP address is not 127.0.0.1 in the future. If not set, by default, except for local localhost connections, other external IP connections will be invalid. Although their IP is bound on 0.0.0.0, they still have no permissions.
8. Next, we continue to enter 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, the editor enters the command in the Ubuntu command line according to his own situation: grant all privileges on *.* to 'root'@'% ' identified by '123456' with grant option ;
*.* is a regular expression, which represents authorization for all tables; root represents the root user; % represents all external IPs; 123456 represents the password.
As shown in the figure below:
10. After authorization, enter the command: "flush privileges;" to refresh the permissions, as shown in the figure above. After that, you can exit the mysql database.
11. At this time, go to Navicat and try the connection test again, as shown in the figure below. At this point you can see that the test connection is successful.
12. Click OK, and then you can see on the Navicat main page that the database with the IP address 192.168.255.131 is already in Navicat.
13. Double-click the 192.168.255.131 database on the left to see the database information. After that, you can remotely operate the database in Navicat, which is synchronized with the database in Ubuntu.
The above is the detailed content of How to connect navicat to msql on ubuntu. For more information, please follow other related articles on the PHP Chinese website!

Alternatives to Navicat include DBeaver, DataGrip and HeidiSQL. 1.DBeaver is an open source tool suitable for users who need custom functions. 2.DataGrip is developed by JetBrains and is suitable for users who need a professional SQL development environment. 3.HeidiSQL is a lightweight tool suitable for small projects and individual users.

Navicat's pricing model includes three versions: NavicatPremium, Navicatfor [Specific Database] and NavicatEssentials. 1.NavicatPremium supports all databases, perpetual license $1299, annual subscription $299, monthly subscription $29.2.Navicatfor\[Special Database\] for a single database, perpetual license $799, annual subscription $19, monthly subscription $19.3.NavicatEssentials Feature Basics, perpetual license $299, annual subscription $99, monthly subscription $9.

Navicat improves database workflow through core functions such as data modeling, SQL development, data transmission and synchronization. 1) Data modeling tools allow the design of database structures by dragging and dropping. 2) SQL development tools provide syntax highlighting and automatic completion to improve the SQL writing experience. 3) The data transmission function automatically handles data type conversion and consistency checks to ensure smooth data migration. 4) The data synchronization function ensures data consistency in development and production environments.

Navicat supports a variety of database systems, such as MySQL, PostgreSQL, etc., and provides functions such as data model design, SQL query, etc. With Navicat, you can: 1. Connect to the database and execute queries; 2. Perform data synchronization and backup; 3. Reduce errors through syntax highlighting and automatic completion; 4. Use batch operations and index optimization to improve performance.

Navicat and MySQL are perfect matches because they can improve database management and development efficiency. 1.Navicat simplifies MySQL operations and improves work efficiency through graphical interfaces and automatic generation of SQL statements. 2.Navicat supports multiple connection methods, which facilitates local and remote management. 3. It provides powerful data migration and synchronization capabilities, suitable for advanced usage. 4.Navicat helps with performance optimization and best practices such as regular backup and query optimization.

Navicat offers a 14-day trial period and a variety of license options. 1. The trial version allows you to experience all functions for free, and enter read-only mode after the expiration. 2. The license provides continuous use rights and value-added services, which need to be purchased and activated. Through trials and licenses, users can take advantage of the power of Navicat.

Alternatives to Navicat include DBeaver, DataGrip, HeidiSQL, and pgAdmin. 1.DBeaver is free and open source, suitable for individual developers and small teams. 2.DataGrip is powerful and suitable for large-scale projects and team collaboration. 3.HeidiSQL focuses on MySQL and MariaDB, with a simple interface. 4.pgAdmin is specially designed for PostgreSQL and has comprehensive functions.

Navicat can connect to and manage a variety of databases, including MySQL, PostgreSQL, etc. 1) Add database connection through the connection manager and set parameters such as host address, port number, etc. 2) After the connection is successful, you can switch the database in the navigation bar to operate. 3) Navicat communicates with the database through JDBC or ODBC, and user operations are executed through a graphical interface.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 English version
Recommended: Win version, supports code prompts!

Atom editor mac version download
The most popular open source editor

Notepad++7.3.1
Easy-to-use and free code editor

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
