Categories: 学无止境

CentOS上开启MySQL远程访问

在CentOS上安装完MySQL后,默认不开始远程访问控制。可以进行如下设定开启。

登录MySQL: mysql -uroot -p

如需修改密码,第一次: mysqladmin -u root password NEWPASSWORD 已设置过: mysqladmin -u root -p 'oldpassword' password newpassword

 

执行以下命令开启远程访问限制 grant all privileges on *.* to 'root'@'192.168.0.1' identified by 'password' with grant option; flush privileges; exit

上面的是开启的IP 192.168.0.1的,如要开启所有的,用%代替IP

 

1、mysql -uroot -p
2、grant all privileges on *.* to root@"%" identified by "password" with grant option;
3、flush privileges;
4、exit;
默偌克

Share
Published by
默偌克

Recent Posts

在HTML中放大Unicode图标

在HTML中放大Unicode…

4 days ago

服务器更换系统,博客更换主题

这段时间快过年了,由于工作有所…

5 days ago

通过本地下载解决Docker镜像慢的问题

最近在NAS上装了个Docke…

6 days ago

RockyLinux 10默认集成Web console管理功能

RockyLinux安装都是很…

1 month ago

永久修改Anolis的网卡IP地址

登入root后 1.先输入 i…

2 months ago