關於阿裏雲centos版本,mysql5.7的一些註意事項
阿新 • • 發佈:2017-07-26
word xxxxxx str linux服務 配置 linu ron 訪問服務器 nbsp
1.阿裏雲進去mysql是默認已經安裝好了的,只需要修改root用戶的密碼。關於修改密碼:
1)登陸阿裏雲,進入root目錄,會有mysql的.sh文件,可以通過運行該文件得到初始密碼。此時用初始密碼登陸mysql,use mysql 切換到mysql數據庫
2) UPDATE user SET authentication_string = password ( ‘new-password‘ ) WHERE User = ‘root‘ ;//註意不再是Password
3)set password = password(‘xxxxxxxx‘);
4) flush privileges //刷新權限
2.使用本地Navicat訪問遠程linux服務器的mysql:
如果出現Host‘xxx.xxx.xxx.xxx‘ is not allowed to connect to this MySQL server,就需要給mysql表中的host授權本地ip
1)登錄linux服務器的數據庫
2)use mysql
3)grant all privileges on *.* to root@"ip號碼" identified by "密碼"; //此處的ip指的就是報錯中不能訪問的ip地址
4)可以通過select user,host from user中查詢,linux服務器的ip和本機的ip地址都會顯示在host列中。
5)這個時候就可以用navicat訪問雲中的mysql了。
註意:阿裏雲有個安全組,訪問服務器某端口時,必須要在安全組裏面把端口配置好。
關於阿裏雲centos版本,mysql5.7的一些註意事項