Skip to main content

2 posts tagged with "mysql"

View All Tags

· One min read
Ma Chu

message from server: "Host '192.168.7.233' is not allowed to connect to this MySQL server
远程连接数据库时报错

原因

mysql数据库只允许自身所在的本机器连接,不允许远程连接。

解决

mysql -u root -p
use mysql;
select host from user where user = 'root';
update user set host = '%' where user = 'root';
flush privileges;
image

· One min read
Ma Chu
select @@global.sql_mode;
set @@global.sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'