mysql禁止外部访问解决方案
1.在端口已经开放的情况下,ubuntu mysql 3306允许远程访问
vim /etc/mysql/mysql.conf.d/mysqld.cnf
注释#bind-address = 127.0.0.1
2.给用户授权允许远程访问:
grant all privileges on *.* to root@"%" identified by "pwd" with grant option;
flush privileges;
创建和授权用户某些权限的测试,在mysql数据库的user表里进行的操作
1.mysql创建用户:
CREATE USER 'taoshihan'@'localhost' IDENTIFIED BY '';
localhost是只是本地
%是允许远程
CREATE USER 'taoshihan115'@'%' IDENTIFIED BY 'TAOshihan1';
删除用户:
drop user 'taoshihan'@'localhost'
2.授权:
GRANT select ON *.* TO 'taoshihan115'@'%';授权指定
GRANT all ON *.* TO 'taoshihan115'@'%';授权所有
当mysql重启不了的时候,看看日志目录比如/var/log/mysql 是否存在,属组和属主是否是mysql
如果没有,创建目录,并更改目录的所有者 chown mysql:mysql
相关推荐
CoderToy 2020-11-16
bianruifeng 2020-11-16
云中舞步 2020-11-12
敏敏张 2020-11-11
暗夜之城 2020-11-11
好记忆也需烂 2020-11-11
Coder技术文摘 2020-09-29
huacuilaifa 2020-10-29
Gexrior 2020-10-22
lpfvip00 2020-10-07
云中舞步 2020-09-11
康慧欣 2020-09-10
emmm00 2020-11-17
王艺强 2020-11-17
ribavnu 2020-11-16
wangshuangbao 2020-11-13
苏康申 2020-11-13
vivenwan 2020-11-13