国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 數(shù)據(jù)庫(kù) > MySQL > 正文

詳解遠(yuǎn)程連接Mysql數(shù)據(jù)庫(kù)的問(wèn)題(ERROR 2003 (HY000))

2024-07-24 13:01:47
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

在我們用客戶端及其遠(yuǎn)程連接服務(wù)器Mysql數(shù)據(jù)庫(kù)的過(guò)程中,容易出現(xiàn)下面問(wèn)題:
問(wèn)題代碼代碼
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.0.19' (111)
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.0.19' (111)這個(gè) 原因就是Mysql數(shù)據(jù)庫(kù)的默認(rèn)配置文件my.cnf(linux下)中的bind-address默認(rèn)為127.0.0.1,所以就算你創(chuàng)建了可以 remote訪問(wèn)的用戶,你也不能使用mysql -h命令進(jìn)行訪問(wèn),若訪問(wèn)就會(huì)出現(xiàn)上出問(wèn)題,因?yàn)榇藭r(shí)Mysql只接受localhost,所以需要把bind-address屏蔽掉。

my.cnf一般在/etc/mysql下面,如果不在使用locate my.cnf查找,修改前的my.cnf配置文件為:

修改前的my.cnf配置文件代碼
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address= 127.0.0.1
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address= 127.0.0.1
我們需要做的就是屏蔽這個(gè)bind-address代碼,屏蔽后代碼為:

屏蔽后my.cnf配置文件代碼
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address= 127.0.0.1
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address= 127.0.0.1
現(xiàn)在你就可以用mysql -h命令進(jìn)行你想做的操作了,如登錄系統(tǒng):

登陸數(shù)據(jù)庫(kù)代碼
mysql -h 192.168.0.19 -u root -p

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 红安县| 元谋县| 南开区| 临桂县| 呼图壁县| 沂水县| 商城县| 山阳县| 丰城市| 佛坪县| 高阳县| 洛扎县| 海宁市| 乌兰察布市| 富锦市| 洱源县| 牡丹江市| 迭部县| 会东县| 定结县| 合肥市| 西乌| 科技| 土默特右旗| 花莲市| 方山县| 宜兰市| 乐安县| 甘南县| 自治县| 天柱县| 儋州市| 曲水县| 集安市| 聂拉木县| 黄浦区| 福泉市| 常州市| 东辽县| 城市| 临漳县|