ERROR 2003 (HY000): Can't connect to MySQL server on ... 113

1
2
3
4
5
6
7
8
9
telnet 192.168.1.165 3306
 
# firewall in ubuntu
sudo ufw disable
 
# or found ip changed
vi /etc/mysql/mysql.conf.d/mysqld.cnf
systemctl restart mysql
systemctl status mysql

refer to:
https://blog.csdn.net/zhangasas/article/details/89432832

mysql备忘录

密码问题

1
2
3
#/etc/my.cnf
[mysqld]
skip-grant-tables=1
1
2
FLUSH privileges;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'admin@123';

重启

1
systemctl restart mysqld

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException:
Could not create connection to database server. Attempted reconnect 3

https://www.cnblogs.com/ianhuafeng/p/12403626.html
https://zhuanlan.zhihu.com/p/632935077

Install MySql in Windows, download zip file from https://dev.mysql.com/downloads/windows/installer/5.7.html

mysqld --initialize --console
mysqld --install mysql
net stop mysql
mysqld --skip-grant-tables
	mysql -u root -p
		use mysql;
		select * from user;
		update user set authentication_string=password("123456") where user="root";
		flush privileges;
net start mysql

refer to:
https://www.cnblogs.com/huaisn/articles/14149356.html