Home >Database >Mysql Tutorial >CentOS上开启MySQL远程访问权限

CentOS上开启MySQL远程访问权限

WBOY
WBOYOriginal
2016-06-07 17:26:181221browse

在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

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn