liyihua

第一步:找到安装包地址 —— 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

分类:

技术点:

相关文章:

  • 2021-04-20
  • 2022-12-23
  • 2021-11-26
  • 2021-10-01
  • 2022-01-13
  • 2021-11-05
  • 2021-12-14
  • 2022-12-23
猜你喜欢
  • 2021-10-01
  • 2023-03-15
  • 2022-03-09
  • 2021-04-10
  • 2021-08-15
  • 2021-06-14
  • 2021-05-24
相关资源
相似解决方案