Mac 下安装 MySQL 经历
1.使用 homebrew 安装:
brew install mysql
结果报错:
$ brew install mysql
==> Downloading http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.19.tar.gz/from/http://cdn.mysql.com/ curl: () The requested URL returned error: Not Found
Error: Download failed: http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.19.tar.gz/from/http://cdn.mysql.com/
这时升级一下你的 homebrew:
brew update
安装完成后,然后又报错:
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink share/man/man8/mysqld.
/usr/local/share/man/man8 is not writable.
真是坎坷。。。
解决方法:
#开启权限
$ sudo chown -R $(whoami) /usr/local/
#重新link一次
$ brew link mysql
这下总算安装完成了。
2.配置 mysql :
进入 sql 指令模式:
mysql -uroot -p
然后报错:
Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
表明我们没有启动 mysql 服务。
所以启动服务:
mysql.server start
3.设置 root 账户密码:
mysql_secure_installation
然后出现下列配置选项:
(1)
VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?
Press y|Y for Yes, any other key for No:
Please set the password for root here.
New password:
Re-enter new password:
询问你是否安装 VALLDATE PASSWORD 这个套件(可以帮助你验证密码的复杂度,设置的太简单会提醒你),我并没有安装这个套件,直接 enter 后输入两次密码结束。
(2)
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.
Remove anonymous users? (Press y|Y for Yes, any other key for No) :
是否移除匿名使用者?选 y 。
(3)
Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.
Disallow root login remotely? (Press y|Y for Yes, any other key for No) :
是否关闭 root 远端登入?选 y 。
(4)
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.
Remove test database and access to it? (Press y|Y for Yes, any other key for No) :
是否移除测试资料库?选 y 。
(5)
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) :
是否直接重新读取权限?选 y 。
4.再次尝试进入 sql 指令模式:
mysql -uroot -p

成功!
到这步我们便完成了 MySQL 的安装。
******
以Service方式启动/停止/重启MySQL命令:
service mysqld start
service mysqld stop
service mysqld restart
Mac 下安装 MySQL 经历的更多相关文章
- Mac下安装Mysql出现 Can’t connect to local MySQL server through socket '/tmp/mysql.sock'
在Mac下安装mysql出现 Can't connect to local MySQL server through socket '/tmp/mysql.sock' 错误,解决如下: $ unset ...
- 配置apache,及mac下安装mysql
先打开apache,在浏览器上输入 localhost 回车后会如果屏幕上显示:It works! 如下图: 这说明你的apache已开启 在window下配置apache: 1.找到apa ...
- mac 初次配置apache,及mac下安装mysql
先打开apache,在浏览器上输入 localhost 回车后会如果屏幕上显示:It works! 如下图: 这说明你的apache已开启 mac 下apache配置(mac自带apache ...
- Mac下安装MySQL 5.6.40
Mac下安装MySQL 5.6.40 - 干勾鱼的CSDN博客 - CSDN博客 原创 Mac下安装MySQL 5.6.40 2018-06-18 10:34:03 我是干勾鱼 阅读数 5927 ...
- 在Mac下安装MySQL
在Mac下安装MySQL 最近开始将开发工具都转移到 Mac 上了,其中也会莫名其妙的遇到一些坑,不如干脆将整个流程都记录下来,方便以后查找. 下载与安装 首先进入 MySQL 官网,选择免费的C ...
- Mac 下安装 MySQL 步骤
安装 MySQL Mac 下安装MySQL推荐去官网下载dmg 版本的,我使用的版本是5.7.30. 如上图所示. 之后就是傻瓜式一键狂点不过需要注意的是,不要关闭下图所示的框框!不要关闭下图所示的框 ...
- Mac下安装MySQL及启动等常用命令
总结了下mac下的mysql安装步骤: eclipse JavaEE 下载 JDK -9 macosx下载 一.安装及启动服务 1. MySQL Server 下载.(以mys ...
- Mac下安装Mysql以及修改Mysql密码
1.安装Mysql 安装有2种办法,一种是下载mysql安装文件,慢慢安装,另一种就是下载xmpp,里面自带mysql,就像是安装普通的mac软件一样,安装完毕,就有了mysql了. 方法一,官网下载 ...
- mac下安装mysql 1820 重置默认密码
mac安装mysql时会给出一个临时密码 记录下来 2018-03-17T02:14:10.809431Z 1 [Note] A temporary password is generated for ...
随机推荐
- Active MQ 实战(一)
1.什么是JMS JMS即Java消息服务(Java Message Service)应用程序接口,是一个Java平台中关于面向消息中间件(MOM)的API,用于在两个应用程序之间,或分布式系统中发送 ...
- Idea简单SpringMVC框架配置
前边已经介绍过了Struts在Idea上的配置,相对于Struts来说,我觉得SpringMVC有更多的优势,首先Struts是需要对action进行配置,页面发送不同的请求,就需要配置不同的acti ...
- Beta冲刺 第三天
Beta冲刺 第三天 1. 昨天的困难 昨天的困难主要集中在对Ajax的使用上,不熟悉这种语法,所以也就浪费了时间,导致昨天的批量删除没有完全完成. 2. 今天解决的进度 潘伟靖: 1.完善了昨天没写 ...
- OSI七层协议模型、TCP/IP四层模型学习笔记
1. OSI七层和TCP/IP四层的关系 1.1 OSI引入了服务.接口.协议.分层的概念,TCP/IP借鉴了OSI的这些概念建立TCP/IP模型. 1.2 OSI先有模型,后有协议,先有标准,后进行 ...
- 2017 清北济南考前刷题Day 4 afternoon
期望得分:30+50+30=110 实际得分:40+0+0=40 并查集合并再次写炸... 模拟更相减损术的过程 更相减损术,差一定比被减数小,当被减数=减数时,停止 对于同一个减数来说,会被减 第1 ...
- nyoj 概率计算
概率计算 时间限制:1000 ms | 内存限制:65535 KB 难度:1 描述 A和B两个人参加一场答题比赛.比赛的过程大概是A和B两个人轮流答题,A先答.一旦某人没有正确回答问题,则对手 ...
- JAVA_SE基础——31.this关键字
黑马程序员入学blog... 也算是学习笔记体会. this的通俗解释: 有一个A类,一个B方法,一个C变量,其中B和C都在类A中 this.B()就是调用A类中的B方法 this.C=1(假设C是一 ...
- Django REST framework+Vue 打造生鲜超市(一)
一.项目介绍 1.1.掌握的技术 Vue + Django Rest Framework 前后端分离技术 彻底玩转restful api 开发流程 Django Rest Framework 的功能实 ...
- Python内置函数(34)——map
英文文档: map(function, iterable, ...) Return an iterator that applies function to every item of iterabl ...
- dubbo debug过程中一个有趣的问题
最近在debug dubbo代码过程中遇到的很有趣的问题 我们都知道dubbo ReferenceBean是消费者的spring bean包装,为了查一个consumer端的问题,在Reference ...