当前位置:   article > 正文

Mac—苹果电脑Mac OS下载并安装本地Mysql服务步骤详解_mac下载mysql

mac下载mysql

技术公众号:后端技术解忧铺
关注微信公众号:CodingTechWork,一起学习进步。

引言

  使用mac安装mysql服务端供自己本地调试使用。

下载Mysql安装包

  1. 官方下载链接https://www.mysql.com/downloads/
    点击进入Mysql社区下载页面
    进入Mysql社区下载页面

  2. 选择Mysql社区服务端(Mysql Community Server)下载选择Mysql社区服务端下载

  3. 选择macOS,并选择对应的版本,由于我的mac是英特尔的,而非ARM,所以选择了x86,64-bitDMG压缩包下载。
    选择macOS,并选择对应的版本

  4. 直接点击下载,无需登录或注册
    直接点击下载,无需登录注册

安装Mysql

安装mysql程序

  1. 双击mysql安装包
    双击安装包
  2. 不断点击继续
    点击继续
    期间,会遇到输入密码,输入8位即可。

配置环境变量

打开终端执行以下操作

  1. 加入mysql环境变量
    执行vim ~/.bash_profile,加入环境变量PATH=$PATH:/usr/local/mysql/bin,保存并退出。
  2. 环境变量生效
    执行source ~/.bash_profile

验证使用

  1. 在终端输入mysql --version显示对应的版本
mysql  Ver 8.0.29 for macos12 on x86_64 (MySQL Community Server - GPL)
  • 1
  1. 登录mysql后台
    mysql -uroot -p,输入密码
[xxxx %] mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.29 MySQL Community Server - GPL

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

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> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25

关闭mysql

  1. 系统偏爱设置中
    页面点击mysql
    关闭mysql服务
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/410032
推荐阅读
相关标签
  

闽ICP备14008679号