Ubuntu的web服务器搭建系列之MySQL(JDK+Tomcat+MySQL+Nginx+Red
mysql -u root -p 123456 #登录mysql use mysql; #进入数据库mysql# 查看现在的用户信息
SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;
delete from user where user=''; # 删除匿名用户
# 增加允许远程访问的用户(给root授予在任意主机(%)访问任意数据库的所有权限)
grant all privileges on *.* to 'root'@'%'> # 如果不想增加记录,只是想给已存在的用户添加
update user set host='%' where user='root' and host='localhost';
# 刷新系统权限表
flush privileges;
# 退出数据库
exit
页:
[1]