我一般習慣終端直接安裝,加之前幾天因為要安裝git,已經安裝好了homebrew。(homebrew安裝方法可以mac相關分類里面mac安裝git)
1.mysql安裝
直接輸入下面命令進行安裝:
brew install mysql
安裝完成以后,mysql會給出提示是否重啟,可以直接啟動mysql, 命令如下:
bash mysql.server start
查看mysql版本命令 :
mysql --version
登陸mysql:
mysql -uroot
設置root用戶密碼:
set password for 'root'@'localhost'='123';
之后正常訪問即可。
2.navicat鏈接數據庫
1)navicat 可以通過我x.client網站下載。
2)安裝之后,通過“connection” 選擇mysql,然后輸入
a commection name : 名字可以自己起
b host : IP 地址
c port : 端口號 一般默認是3306
d user name : root (也可以是創建的其他賬戶)
e password : 123
即可正常鏈接。
浙公網安備 33010602011771號