Linux command Navicat connect to MySQL database under Linux

Source: Internet
Author: User
Tags nginx server

December 7, 2016 18:44:06

-====------------------------

GRANT all privileges on * * to ' itoffice ' @ ' percent ' identified by ' Itoffice ' with GRANT OPTION;
(The first itoffice represents the user name,% means that all computers can connect, you can set an IP address to run the connection, and the second itoffice represents a password). This command allows all the root user to enter the password login to the MySQL server, if the '% ' transfer ' 192.168.1.124 ', then only ' 192.168.1.124 ' host can log on 1, using the root user login to Linux, Log in to the root user of MySQL and change the range of IP addresses allowed to log in.
[Email protected] ~]# mysql-u root-p

Mysql>grant all privileges on * * to ' root ' @ '% ' identified by ' password ' with GRANT option;

Execute flush privileges; Command takes effect immediately

The user who queried the database (see the following indicating that the creation of the new user succeeded)
SELECT DISTINCT CONCAT (' User: ', user, ' @ ', host, '; ') as query from Mysql.user;
2. Exit MySQL using the exit command
Then open vim/etc/mysql/my.cnf.
Will bind-address = 127.0.0.1
Set to Bind-address = 0.0.0.0 (device address) (the new version of Bind-address is bound to 0.0.0.0 without setting?). )
Note: netstat-apn| grep 3360 View 3306 Port status Finally, I found a strange thing. TCP        0      0 127.0.0.1:3306            0.0.0.0:*               LISTEN      3783/  Mysqld above the red place, the listening port is normal, but bind the local roundabout address, no wonder always connected, so looked up the following information, found the solution: Modify the MySQL configuration file/etc/mysql/ My.conf, the bind-address will be added to the remote access IP address or ban this sentence can let the remote machine login access. 


Reboot (command below):
/etc/init.d/mysqld stop
/etc/init.d/mysqld start
or restart or restart Apache or Nginx server (not recommended)

View Port Numbers
Show global variables like ' port ';

Sets the Navicat connection.

Click Connect Test to see that the following indicates success.

Linux command Navicat connect to MySQL database under Linux

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.