Navicat MySQL connection error under various Windows, Linux system, change the password.

Original: Navicat connected Windows, MySQL various errors in the Linux system, change the password.

Foreword

Use MySQL5.7 database Navicat link in Ali cloud server centos, reported several wrong.
There are students to use their own connections in Navicat for Windows installed MySQL 5.7 database. Also being given.
So special to, to sum up today.

First, the errors collection

Error 1: 2003

2003-Can’t connect to Mysql server on ‘xxx’ (10060 “Unknown error”)

  1. First, execute the following command to allow root users to connect remotely, your connection to mysql server from any host
    Replace yourpasssword password for your database
    GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'yourpassword' WITH GRANT PTION;

  2. Refresh permission allows the operator to take effect
    FLUSH PRIVILEGES;

  3. Execution quit; out of the database, execute the following command to open the firewall port 3306, if the firewall is not necessary to shut down two steps.
    firewall-cmd --zone=public --add-port=3306/tcp --permanent

  4. Restart the firewall and see if the entry into force of
    firewall-cmd --reload# restart firewall
    firewall-cmd --list-portsport # View has an open
    operation is complete, the connection can be pleasant to use slightly navicat

Error two: 1045

1045 - Access denied for user 'root'@'111.14.201.154' (using password: YES)

Linux is installed on the server msyql database, MySQL under Linux default permissions after installation only local access, remote access do not have permission, you need to specify the user to set access rights to access the database remotely, following the record about my approach:
Here Insert Picture Description
grant all privileges on *.* to 'root'@'%' identified by 'root';

Here's root on behalf of the root user, the last root password on behalf of the root user, I have here the user name and password are root, the middle number represents% of all ip addresses can remotely access, if you want to open for a remote machine access rights, which would replace the% machine ip address, so it can only be mysql database under the machine remotely access the linux.

Error three: 2013

[Error contents]:2013-Lost connection to MYSQL server at 'waiting for initial communication packet',system error:0

[] Produce a wrong: when you link MySQL.

[Solution]: Open my.cnf (MySQL configuration file called under Windows my.ini, in the installation root directory of MySQL; called my.cnf on Linux, this file is located /etc/my.cnf.),
Found [mysqld] item by adding the words thereafter :skip-name-resolve, save, restart the mysql service can ~

Error Four: Modify MySQL password

ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO);
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: YES)
dos window displays the following message when you log mysql, often due to various reasons need to reset your password.
Directly under the second chapter of violence to change the password.

Second, change your password

1, violent way: the way modify the configuration file

  1. This Computer -> Right Management -> Services and Applications -> Services to find the MySQL -> Right Properties -> find my.ini file in the path path, and then open it.

  2. Find the configuration file my.ini, then open it, can choose to use Notepad to open, [mysqlId] below to add skip-grant-tables, save and exit.
    It means skipping password to log.
    Here Insert Picture Description

  3. Then restart the mysql service. Turn off the service back on. You can also manually restart the service to the service.
    net stop MySQL
    net start MySQL

  4. Last Login mysql to change the password.
    mysql -uroot -pAfter a carriage return, will enter a password, hit enter, type the next command line.
    update MySQL.user set authentication_string=password('root') where user='root';The first is the root password
    flush privileges;refresh permission

  5. Delete my.ini file skip-grant-tables, restart the service.

Guess you like

Origin www.cnblogs.com/lonelyxmas/p/12301072.html