mac安装mysql8.0.11_Mac下安装mysql8.0.11

1、下载MySQL Community版本:8.0.11,本次例子是以dmg安装的方式,下载的文件名为:mysql-8.0.11-macos10.13-x86_64.dmg

下载地址:https://dev.mysql.com/downloads/mysql/  下载需要自己登录oracle账号

2、下载后双击安装,安装的时候指设置下mysql root密码

3、用工具链接mysql,如果出现提示:

Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/mysql/lib/plugin/caching_sha2_password.so, 2): image not found

需要重新配置下密码方式

配置如下:

点击左上角苹果图标,进入系统偏好设置

点击底下部分MySQL提示

点击Initialize Database,初始化数据库

在Please enter a password for the database "root" user: 输入框中输入密码

选中Use Legacy Password Encryption后在点击OK按钮

弹出框中输入系统管理员密码

初始化后再再MySQL页面点击 Start MySQL Server 按钮,启动mysql。在用客户端连服务端,就能正常连接了

4、安装完成后,在命令行中输入mysql命令,提示:-bash: /usr/local/bin/mysql: No such file or directory

需要把安装的bin的路径放到环境变量中去,设置方法:

用户home 目录下 在.bash_profile 文件中 添加一行   export PATH=$PATH:/usr/local/mysql-8.0.11-macos10.13-x86_64/bin

再执行命令: source .bash_profile 让设置的环境变量生效

到这一步,整个安装mysql 都完成了并能正常使用

安装完成后,登录mysql ,通过source 命令导入sql文件:

C02M71L9F8J2:Downloads pub_pawf_autotest$mysql -u root -p

Enter password:

Welcome to the MySQL monitor.Commands end with ; or \g.

Your MySQL connection id is 22

Server version: 8.0.11 MySQL Community Server - GPL

Copyright (c) 2000, 2018, 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> source 20180407.sql

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值