php 不允许外部访问,[日常] 解决mysql不允许外部访问
1.在端口已經(jīng)開放的情況下,ubuntu mysql 3306允許遠程訪問
vim /etc/mysql/mysql.conf.d/mysqld.cnf
注釋#bind-address = 127.0.0.1
2.給用戶授權(quán)允許遠程訪問:
grant all privileges on *.* to root@"%" identified by "pwd" with grant option;
flush privileges;
創(chuàng)建和授權(quán)用戶某些權(quán)限的測試,在mysql數(shù)據(jù)庫的user表里進行的操作
1.mysql創(chuàng)建用戶:
create user 'taoshihan'@'localhost' identified by '';
localhost是只是本地
%是允許遠程
create user 'taoshihan115'@'%' identified by 'taoshihan1';
刪除用戶:
drop user 'taoshihan'@'localhost'
2.授權(quán):
grant select on *.* to 'taoshihan115'@'%';授權(quán)指定
grant all on *.* to 'taoshihan115'@'%';授權(quán)所有
當mysql重啟不了的時候,看看日志目錄比如/var/log/mysql 是否存在,屬組和屬主是否是mysql
如果沒有,創(chuàng)建目錄,并更改目錄的所有者 chown mysql:mysql
希望與廣大網(wǎng)友互動??
點此進行留言吧!
總結(jié)
以上是生活随笔為你收集整理的php 不允许外部访问,[日常] 解决mysql不允许外部访问的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: macbook怎么用优盘 如何使用优盘在
- 下一篇: u盘上面的东西怎么删除不成 &q