mac下安裝mysql忘記密碼的修改方法
一、mac下安裝MySQL數(shù)據(jù)庫
1.下載MySQL數(shù)據(jù)庫
下載地址:訪問MySQL的官網(wǎng)http://www.mysql.com/downloads/ ,進行下載。
進入MySQL的下載界面(http://www.mysql.com/downloads/mysql/)
下載x86,64bit的dmg文件:直接選擇最下面的“No thanks,just take me to downloads!”
2.安裝MySQL數(shù)據(jù)庫
打開MySQL安裝包后,點擊安裝主程序pkg文件。
3.啟動MySQL數(shù)據(jù)庫
打開MYSQL數(shù)據(jù)庫文件方式,在系統(tǒng)偏好設(shè)置中打開,點擊MySQL,start mysql server ,即可啟動MySQL。
4.終端登錄MySQL數(shù)據(jù)庫:
mysql -u root -p
回車,默認密碼為空。出現(xiàn)password后回車即可。
二、安裝數(shù)據(jù)庫后發(fā)現(xiàn)忘記了數(shù)據(jù)庫密碼
1.首先關(guān)閉MySQL數(shù)據(jù)庫
系統(tǒng)偏好設(shè)置中關(guān)閉MySQL,stop mysql server
2.進入安全模式
? bin sudo su Password: Sorry, try again. Password: sh-3.2# ./mysqld_safe --skip-grant-tables & [1] 3477 sh-3.2# 2017-06-27T08:32:37.6NZ mysqld_safe Logging to '/usr/local/mysql-5.7.18-macos10.12-x86_64/data/localhost.err'. 2017-06-27T08:32:37.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql-5.7.18-macos10.12-x86_64/data sh-3.2#
3.重新啟動一個終端
~ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 16 Server version: 5.7.18 MySQL Community Server (GPL) Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
4.輸入命令
mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.06 sec)
5.重新設(shè)置密碼
mysql> SET PASSWORD FOR root@'localhost' = PASSWORD('root');
Query OK, 0 rows affected, 1 warning (0.02 sec)
6.再次輸入命令
mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec)
以上所述是小編給大家介紹的mac下安裝mysql忘記密碼的修改方法,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
- MAC下MYSQL數(shù)據(jù)庫密碼忘記的解決辦法
- Mac系統(tǒng)下MySql下載MySQL5.7及詳細安裝圖解
- Mac OS系統(tǒng)下mysql 5.7.20安裝教程圖文詳解
- linux/mac安裝mysql忘記密碼的解決辦法
- 在Mac OS X中配置Apache+PHP+MySQL運行環(huán)境的詳細步驟
- mac安裝mysql初始密碼忘記怎么辦
- Mac下安裝mysql5.7.18的詳細步驟
- Mac下MySQL安裝配置教程
- MySql在Mac上的安裝與配置詳解
- Mac系統(tǒng)下源碼編譯安裝MySQL 5.7.17的教程
- MAC 中mysql密碼忘記解決辦法
- 在Mac系統(tǒng)上配置MySQL以及Squel Pro
相關(guān)文章
Win10 MySQL如何解決secure_file_priv在my.ini無法設(shè)置問題
這篇文章主要介紹了Win10 MySQL如何解決secure_file_priv在my.ini無法設(shè)置問題,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教2024-04-04
MySQL server has gone away的問題解決
本文主要介紹了MySQL server has gone away的問題解決,意思就是指client和MySQL server之間的鏈接斷開了,下面就來介紹一下幾種原因及其解決方法,感興趣的可以了解一下2024-07-07
mysql存儲過程基礎(chǔ)之遍歷多表記錄后插入第三方表中詳解
這篇文章主要給大家介紹了關(guān)于mysql存儲過程教程之遍歷多表記錄后插入第三方表中的相關(guān)資料,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面來一起看看吧2018-07-07
select?into?from和insert?into?select的使用舉例詳解
select into from和insert into select都是用來復(fù)制表,下面這篇文章主要給大家介紹了關(guān)于select?into?from和insert?into?select使用的相關(guān)資料,文中通過實例代碼介紹的非常詳細,需要的朋友可以參考下2023-04-04

