標籤:justify 資料庫 color
@font-face { font-family: "宋體";}@font-face { font-family: "Cambria Math";}@font-face { font-family: "@宋體";}@font-face { font-family: "Calibri";}@font-face { font-family: "Helvetica Neue";}p.MsoNormal, li.MsoNormal, div.MsoNormal { margin: 0 0 0; text-align: justify; font-size: 14px; font-family: Calibri; }h3 { margin: 17px 0; text-align: justify; line-height: 172%; page-break-after: avoid; font-size: 21px; font-family: Calibri; font-weight: bold; }a:link, span.MsoHyperlink { color: blue; text-decoration: underline; }a:visited, span.MsoHyperlinkFollowed { color: rgb(149, 79, 114); text-decoration: underline; }p { margin-right: 0; margin-left: 0; font-size: 16px; font-family: Calibri; }.MsoChpDefault { font-size: 13px; }div.WordSection1 { }ol { margin-bottom: 0; }ul { margin-bottom: 0; }
一、MySQL 可以用localhost 串連,但不能用IP串連的問題(資料庫遠端存取許可權)
如果在部署項目的時候,探索資料庫不能遠程通過Navicat訪問,或者在程式的設定檔中修改好資料庫IP地址,但是無法訪問的情況,嘗試一下將設定檔改成localhost再次訪問,此時如果改成localhost可以訪問,那麼,需要執行以下SQL語句,開啟當前登入賬戶遠程登入許可權。
1.以root使用者登陸mysql資料庫。
2.執行一下命令分配新使用者:
grant all privileges on *.* to ‘使用者名稱‘@‘IP地址‘ identified by ‘密碼‘;
‘all privileges ‘:所有許可權 也可以寫成 select ,update等。
*.* 所有庫的所有表 如 databasename.*。
IP 資料庫所在的IP。(‘%‘表示所有ip)
identified by ‘密碼’ 表示通過密碼串連。
3.執行完上述命令後用下面的命令重新整理一下許可權
flush privileges;
Mysql添加遠端存取資料庫許可權