Client connection times wrong MySQL database appears: Error1045 Errors, indicates that the user name or password entered is denied access.
The solution can be divided into the following steps:
1. Modify the MySQL configuration file so that you can login MySQL without password
sudo vim/etc/mysql/my.cnf
Add under [mysqld]
Skip-grant-tables
2. Restart the MySQL service
sudo service MySQL restart
3. No password login MySQL
Mysql-uroot-p
4. Modify the Administrator password
Use MySQL;
Update user set Password=password (' 123 ') where user= ' root ';
Flush privileges;
Exit
5. Restore the configuration file
6. You can log in using the following command
Mysql-uroot-p123
2003-can ' t connect to MySQL server on ' x.x.x.x ' (10038)
MySQL service is no problem:
- [Email protected]:~$ ps-ef|grep mysqld
- MySQL 1219 1 0 21:09? 00:00:01/usr/sbin/mysqld
- Sean 10373 9602 0 21:38 pts/7 00:00:00 grep--color=auto mysqld
And the local login can also succeed:
- [Email protected]:~$ mysql-u root-h 127.0.0.1
- Welcome to the MySQL Monitor. Commands End With; or \g.
- Your MySQL Connection ID is 40
- Server version:5.5.47-0ubuntu0.14.04.1 (Ubuntu)
- Copyright (c), Oracle and/or its affiliates. All rights reserved.
- Oracle is a registered trademark of the Oracle Corporation and/or its
- Affiliates. Other names trademarks of their respective
- Owners.
- Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
- Mysql>
However, you cannot log on using an extranet address:
- [Email protected]:~$ mysql-u root-h 192.168.137.128
- ERROR 2003 (HY000): Can ' t connect to MySQL server on ' 192.168.137.128 ' (111)
So I modified the MySQL configuration file:
- [Email protected]:~$ sudo vi/etc/mysql/my.cnf
Add # (Comment out this line) before bind-address= 127.0.0.1 this line
- # Instead of skip-networking The default is now-listen only on
- # localhost which are more compatible and are not less secure.
- #bind-address = 127.0.0.1
Then restart the MySQL service:
- [Email protected]:~$ sudo service mysql restart
- MySQL stop/waiting
- MySQL start/running, process 11622
Error 1130:mysql 1130 effective solution for connection errors
Mysql> UseMySQL; ReadingTableInformation forCompletion of Table and columnnames you can turnoffThis feature toGet a quicker startup with -ADatabasechanged MySQL> SelectHostUser, password from User; +-----------+------------------+-------------------------------------------+ |Host| User |Password| +-----------+------------------+-------------------------------------------+ |localhost|Root| | |Sean|Root| | | 127.0.0.1 |Root| | |::1 |Root| | |localhost|Debian-Sys-Maint| *0aa379ab8afd785b32d661a07e9d5c7a24e3b186| +-----------+------------------+-------------------------------------------+ 5Rowsinch Set(0.00sec) MySQL> Update User SetHost="%"whereHost="Sean" and User ="Root"; Query OK,1Row affected (0.00sec) Rows matched:1Changed:1Warnings:0MySQL>FlushPrivileges; Query OK,0Rows Affected (0.00sec) MySQL> SelectHostUser, password from User; +-----------+------------------+-------------------------------------------+ |Host| User |Password| +-----------+------------------+-------------------------------------------+ |localhost|Root| | | % |Root| | | 127.0.0.1 |Root| | |::1 |Root| | |localhost|Debian-Sys-Maint| *0aa379ab8afd785b32d661a07e9d5c7a24e3b186| +-----------+------------------+-------------------------------------------+ 5Rowsinch Set(0.00Sec
Using Navicat, you can successfully connect to the database.
Ubuntu server installed MySQL database forgot password resolution method