修改数据库连接方式
一、mysql 进入数据库
二、show databases;→use mysql; →show tables; 查看表结构
三、select User,Password,Host from user; 查帐号表数据
四、更新帐号数据
4.1 update user set Host='%' where User='root' and Host = 'localhost'; 将访问数据库的链接方式更改成任何
4.2 update user set User='root' where Host = 'localhost' and User=''; 恢复localhost访问数据库
create user "root"@"127.0.0.1" identified by 'password';【mysql5.7】
4.3 flush privileges; 立即生效更改内容