MacBook 安裝 MySQL 5.7.29(新手都看得懂的安裝教程)


第一步:找到安裝包地址 —— MySQL 下載地址

img

第二步:找到 MySQL 5.7.29 版本

img

第三步: 點擊下載對應的.dmg文件

img

第四步:點擊下載后,會跳轉到另一個頁面

img

第五步:下載完成后,雙擊 mysql-5.7.29-macos10.14-x86_64.dmg 文件,進行安裝

img

第六步:點擊繼續

img

第七步:點擊繼續

img

第八步:點擊同意

img

第九步:點擊安裝(可以更換安裝位置,不知道的可以不用理會,直接點擊安裝),等待安裝

img

第十步:安裝完成后,到摘要這里時,點擊關閉即可。

第十一步:點擊方框中的圖標

img

第十二步:點擊“Start MySQL Server”

img

點擊后可以看到如下圖所示:

img

第十三步:啟動完成后,打開終端,輸入如下內容,然后按回車鍵

alias mysql=/usr/local/mysql/bin/mysql

img

第十四步:輸入如下內容,然后按回車鍵

alias mysqladmin=/usr/local/mysql/bin/mysqladmin

img

第十五步:修改密碼(示例:修改為12345678)

mysqladmin -u root -p password 12345678

img

備注:

MySQL5.7版本密碼設置
MySQL 設置的密碼中必須至少包含一個大寫字母、一個小寫字母、一個特殊符號、一個數字,密碼長度至少為8個字符

第十六步:終端進入MySQL

輸入如下,輸入后按回車即可

mysql -u root -p12345678

備注:

用戶名為:root
密碼為:12345678

出現如下類似情況,說明進入成功:

mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 284
Server version: 5.7.29 MySQL Community Server (GPL)

Copyright (c) 2000, 2019, 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.

mysql> 

如果要退出,輸入"quit"即可

img


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM