mysql 报错1045 - Access denied for user “root” @ 192.111.111.11 (using password: YES)
用navicat連接時(shí)會(huì)報(bào):
nodejs 會(huì)報(bào)這種錯(cuò):TypeError Cannot read property “query ” of undefined
看代碼,很明顯是數(shù)據(jù)庫(kù)連接的問題。打開pool.getConnection( (err, connection) => {})函數(shù)中的err;
1.可能是密碼錯(cuò)誤
2.遠(yuǎn)程權(quán)限沒開
格式:
grant 權(quán)限 on 數(shù)據(jù)庫(kù)名.表名 to 用戶@登錄主機(jī) identified by “用戶密碼”;
@ 后面是訪問MySQL的客戶端IP地址(或是 主機(jī)名) % 代表任意的客戶端,如果填寫 localhost 為本地訪問(那此用戶就不能遠(yuǎn)程訪問該mysql數(shù)據(jù)庫(kù)了)
參考:
Navicat遠(yuǎn)程連接 1045 - Access denied for user ‘root’@’::1’ (using password: YES) 的解決辦法
總結(jié)
以上是生活随笔為你收集整理的mysql 报错1045 - Access denied for user “root” @ 192.111.111.11 (using password: YES)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 阿里云服务器 ,MySQL建库、建表
- 下一篇: jpa 自定义sql if_数据产品经理