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”)
-
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;
-
Refresh permission allows the operator to take effect
FLUSH PRIVILEGES;
-
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
-
Restart the firewall and see if the entry into force of
firewall-cmd --reload
# restart firewall
firewall-cmd --list-ports
port # 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:
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
-
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.
-
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.
-
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
-
Last Login mysql to change the password.
mysql -uroot -p
After 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 -
Delete my.ini file
skip-grant-tables
, restart the service.