mysql 使用 homebrew 安裝
啟動(dòng)方式:
????To have launchd start mysql now and restart at login:
????? ????1,brew services start mysql
????Or, if you don't want/need a background service you can just run:
? ????????2,mysql.server start
關(guān)閉mysql服務(wù)
????第一種方式啟動(dòng):
????????關(guān)閉系統(tǒng)自動(dòng)重啟mysql
????????????1, brew services list
????????????2, brew services stop mysql
????第二種啟動(dòng)方式:
????????sudo /usr/local/mysql/support-files/mysql.server stop 或者系統(tǒng)偏好里有個(gè) MySQL 里關(guān)閉
重置密碼
????cd /usr/local/mysql/bin (mysql 安裝目錄)
????sudo./mysqld_safe --skip-grant-tables &(安全啟動(dòng))
????設(shè)置密碼:
????????1,mysql -uroot -p(提示輸入密碼時(shí)隨便輸入即可)
????????2,flush privileges;(獲取權(quán)限)
????????3,alter user 'root'@'localhost' identified by '123456';(設(shè)置密碼mysql 8.xxx)