Mac下mysql的安裝與卸載

使用homebrew安裝mysql

1省古、安裝mysql

brew install mysql

2、啟動mysql服務(wù)

mysql.server start

3丧失、設(shè)置root密碼

mysql_secure_installation

設(shè)置驗證密碼:

Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?

Press y|Y for Yes, any other key for No: y

There are three levels of password validation policy:

LOW    Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary                  file
// 選一個密碼強度等級
Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 0
Please set the password for root here.
// 按照所選的密碼強度要求設(shè)定密碼
New password:

Re-enter new password:

Estimated strength of the password: 50
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y

//密碼不滿足密碼強度
 ... Failed! Error: Your password does not satisfy the current policy requirements

New password:

Re-enter new password:

Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
//密碼滿足了密碼強度
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

// 是否刪除默認(rèn)無密碼用戶
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.


Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

// 是否禁止遠(yuǎn)程root登錄
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : no

 ... skipping.
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.

// 是否刪除默認(rèn)自帶的test數(shù)據(jù)庫
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
 - Dropping test database...
Success.

 - Removing privileges on test database...
Success.

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.

All done!

4豺妓、登陸

mysql -u root -p

卸載mysql

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
vim /etc/hostconfig  (and removed the line MYSQLCOM=-YES-)
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /var/db/receipts/com.mysql.*

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市布讹,隨后出現(xiàn)的幾起案子琳拭,更是在濱河造成了極大的恐慌,老刑警劉巖描验,帶你破解...
    沈念sama閱讀 216,997評論 6 502
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件白嘁,死亡現(xiàn)場離奇詭異柿扣,居然都是意外死亡澈灼,警方通過查閱死者的電腦和手機,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,603評論 3 392
  • 文/潘曉璐 我一進(jìn)店門荠锭,熙熙樓的掌柜王于貴愁眉苦臉地迎上來呼股,“玉大人耕魄,你說我怎么就攤上這事÷袅” “怎么了屎开?”我有些...
    開封第一講書人閱讀 163,359評論 0 353
  • 文/不壞的土叔 我叫張陵阐枣,是天一觀的道長马靠。 經(jīng)常有香客問我,道長蔼两,這世上最難降的妖魔是什么甩鳄? 我笑而不...
    開封第一講書人閱讀 58,309評論 1 292
  • 正文 為了忘掉前任,我火速辦了婚禮额划,結(jié)果婚禮上妙啃,老公的妹妹穿的比我還像新娘。我一直安慰自己俊戳,他們只是感情好揖赴,可當(dāng)我...
    茶點故事閱讀 67,346評論 6 390
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著抑胎,像睡著了一般燥滑。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上阿逃,一...
    開封第一講書人閱讀 51,258評論 1 300
  • 那天铭拧,我揣著相機與錄音赃蛛,去河邊找鬼。 笑死搀菩,一個胖子當(dāng)著我的面吹牛呕臂,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播肪跋,決...
    沈念sama閱讀 40,122評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼歧蒋,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了澎嚣?” 一聲冷哼從身側(cè)響起疏尿,我...
    開封第一講書人閱讀 38,970評論 0 275
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎易桃,沒想到半個月后褥琐,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,403評論 1 313
  • 正文 獨居荒郊野嶺守林人離奇死亡晤郑,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,596評論 3 334
  • 正文 我和宋清朗相戀三年敌呈,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片造寝。...
    茶點故事閱讀 39,769評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡磕洪,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出诫龙,到底是詐尸還是另有隱情析显,我是刑警寧澤,帶...
    沈念sama閱讀 35,464評論 5 344
  • 正文 年R本政府宣布签赃,位于F島的核電站谷异,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏锦聊。R本人自食惡果不足惜歹嘹,卻給世界環(huán)境...
    茶點故事閱讀 41,075評論 3 327
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望孔庭。 院中可真熱鬧尺上,春花似錦、人聲如沸圆到。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,705評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽芽淡。三九已至马绝,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間吐绵,已是汗流浹背迹淌。 一陣腳步聲響...
    開封第一講書人閱讀 32,848評論 1 269
  • 我被黑心中介騙來泰國打工河绽, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人唉窃。 一個月前我還...
    沈念sama閱讀 47,831評論 2 370
  • 正文 我出身青樓耙饰,卻偏偏與公主長得像,于是被迫代替她去往敵國和親纹份。 傳聞我的和親對象是個殘疾皇子苟跪,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 44,678評論 2 354

推薦閱讀更多精彩內(nèi)容