码迷,mamicode.com
首页 > 数据库 > 详细

CentOS下配置MySQL允许root用户远程登录

时间:2017-11-19 11:14:35      阅读:278      评论:0      收藏:0      [点我收藏+]

标签:登录   sel   额外   数据   mys   记录   文件   支持   roo   

1.常用命令:

安装上传下载文件命令
yum install lrzsz
安装webget工具
yum -y install wget

------------------------------------分割线---------------------------------------------

在CentOS上成功安装MySQL Server后,发现无法用客户端进行连接,查阅相关质料后发现如果想让root用户支持远程登录,是需要进行额外配置的;配置步骤如下:

步骤:

   修改root密码 (可选)

# 切换到mysql这个数据库
mysql> use mysql;

# 将root用户的密码修改为:123456
mysql> update user set password=PASSWORD(‘123456‘) where user=‘root‘;

  

 检查root配置

# root用户登录
$ mysql -u root -p

# 切换到mysql这个数据库
mysql> use mysql;

# 查看root用户配置
mysql> select host,user from user where user=‘root‘;

  修改root配置 

如果查询结果中不包含以下记录,请添加,否则请忽略次步骤

host	user
%	root
mysql> update user set host = ‘%’ where user = ‘root’ and host=’127.0.0.1’;

  给用户授权

mysql> grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘123456‘ with grant option;

  使配置生效

mysql> flush privileges;

  

 

CentOS下配置MySQL允许root用户远程登录

标签:登录   sel   额外   数据   mys   记录   文件   支持   roo   

原文地址:http://www.cnblogs.com/longronglang/p/7859097.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!