After installing MySQL, if you need to connect remotely, you need to do some configuration, otherwise there will be some similar errors, such as
1045 (28000):1045 (28000) MySQL telnet 2003
Can not connect to MySQL error 10061
1 "Can not connect to MySQL error 10061" error occurs when MySQL connects to a server
set the bind-address option in the/etc/mysql/my.conf file to the IP of the MySQL server , which defaults to 127.0.0.1.
Then sudo/etc/init.d/mysql Restart--Restart service
2 "is not allowed to connect to this mysql server" error occurs when MySQL connects to the server
LocalHost of the host column in the user table in the MySQL database is %
DeleteFrom user where user='Root'and host <>'%'; --Remove redundant users update user set host='%'where host='localhost'and user='Root'; --Update HostSelectHost,user,password from user;
+-----------+------------------+-------------------------------------------+| Host | user | password |+-----------+------------------+-------------------------------------------+ | localhost | Debian-sys-maint | *3b3724ae1051d0628525347dac3635a6c523f944 | | % | root | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 | |% | hive | * 4DF1D66463C18D44E3B001A8FB1BBFBEA13E27FC |+-----------+------------------+-------------------------------------- -----+
3 There is no 127.0.0.1 and localhost, so it is not possible to connect with the root user, it will prompt the following error
1045 (28000for 'root'@'localhost ' (using Password:yes)
at this time can only use the system comes with debian-sys-maint user login, give the root user to give new permissions. Debian-sys-maint The user's login password is displayed in clear text in/ETC/MYSQL/DEBIAN.CNF.
Grant all on * * to [email protected]'%'user_password';
4 If you do not want the root user to be Telnet, create a new user
Mysql-u Root-Pinsert into user (Host, User,password)Values("%","Hive", Password ("Hive")); FLUSH privileges; GRANT all Privileges on*. * To'Hive'@'%'Identified by'Hive'; FLUSH privileges;
Ubuntu 14.10 can't connect remotely with MySQL problem