一、打开mac控制台
$ brew install mysql
二、启动mysql服务
$ mysql.server start
三、初始化mysql配置
 1 rainMacBook-Pro:~ comet$ mysql_secure_installation
2
3 Securing the MySQL server deployment.
4
5 Connecting to MySQL using a blank password.
6
7 VALIDATE PASSWORD PLUGIN can be used to test passwords
8 and improve security. It checks the strength of password
9 and allows the users to set only those passwords which are
10 secure enough. Would you like to setup VALIDATE PASSWORD plugin?
11
12 Press y|Y for Yes, any other key for No: N // 这个选yes的话密码长度就必须要设置为8位以上,但我只想要6位的
13 Please set the password for root here.
14
15 New password:  // 设置密码
16
17 Re-enter new password: // 再一次确认密码
18 By default, a MySQL installation has an anonymous user,
19 allowing anyone to log into MySQL without having to have
20 a user account created for them. This is intended only for
21 testing, and to make the installation go a bit smoother.
22 You should remove them before moving into a production
23 environment.
24
25 Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y // 移除不用密码的那个账户
26 Success.
27
28
29 Normally, root should only be allowed to connect from
30 'localhost'. This ensures that someone cannot guess at
31 the root password from the network.
32
33 Disallow root login remotely? (Press y|Y for Yes, any other key for No) : n  //不接受root远程登录账号
34
35 ... skipping.
36 By default, MySQL comes with a database named 'test' that
37 anyone can access. This is also intended only for testing,
38 and should be removed before moving into a production
39 environment.
40
41
42 Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y  //删除text数据库
43 - Dropping test database...
44 Success.
45
46 - Removing privileges on test database...
47 Success.
48
49 Reloading the privilege tables will ensure that all changes
50 made so far will take effect immediately.
51
52 Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
53 Success.
54
55 All done!

Mac下brew安装与配置mysql的更多相关文章

  1. Mac下Maven安装与配置

    Mac下Maven安装与配置 下载maven http://maven.apache.org/download.cgi main->download菜单下的Files 下载后解压在Documen ...

  2. Mac 下 Mosquitto 安装和配置 (Mosquitto为开源的mqtt服务器)

    官网:http://mosquitto.org/download/ 官网的介绍简单明了 Mac 下一个命令“brew install mosquitto” 安装成功了,还学会了brew 安装目录:/u ...

  3. Mac下Git安装及配置

    Mac下: 1.下载git版本并安装 运行终端 查看git版本: bogon:~ yan$ git --version git version 2.16.3 配置gitconfig文件 vim ~/. ...

  4. Mac下charles安装及配置

    一.下载地址 https://www.charlesproxy.com/download/ 激活码 Registered Name: https://zhile.io License Key: 488 ...

  5. Mac下nginx安装和配置

    nginx安装 brew search nginx brew install nginx 安装完以后,可以在终端输出的信息里看到一些配置路径: /usr/local/etc/nginx/nginx.c ...

  6. Mac下brew安装JDK的教程

    ---恢复内容开始--- 安装命令: brew cask install java 默认应该会下载jdk7 也可以指定下载版本brew cask install java6 注意: brew inst ...

  7. Mac Hadoop的安装与配置

    这里介绍Hadoop在mac下的安装与配置. 安装及配置Hadoop 首先安装Hadoop $ brew install Hadoop 配置ssh免密码登录 用dsa密钥认证来生成一对公钥和私钥: $ ...

  8. MAC下安装与配置MySQL

    MAC下安装与配置MySQL   MAC下安装与配置MySQL 一 下载MySQL 访问MySQL的官网http://www.mysql.com/downloads/ 然后在页面中会看到“MySQL ...

  9. CentOS6.7下使用非root用户(普通用户)编译安装与配置mysql数据库并使用shell脚本定时任务方式实现mysql数据库服务随机自动启动

    CentOS6.7下使用非root用户(普通用户)编译安装与配置mysql数据库并使用shell脚本定时任务方式实现mysql数据库服务随机自动启动1.关于mysql?MySQL是一个关系型数据库管理 ...

随机推荐

  1. Solr7.1---简单搜索

    本文环境基于上一节. and搜索 两种用法: apple AND banana +apple +banana [+是一元操作符,要求求后面的查询部分必需在文档中出现.AND是二元操作符,要求其左右两端 ...

  2. 拦截器的使用,配置手机浏览器访问的h5页面

    package com.thinkgem.jeesite.modules.sys.interceptor; import javax.servlet.http.HttpServletRequest; ...

  3. 基于tcp和多线程的多人聊天室-C语言

    之前在学习关于网络tcp和多线程的编程,学了知识以后不用一下总绝对心虚,于是就编写了一个基于tcp和多线程的多人聊天室. 具体的实现过程: 服务器端:绑定socket对象->设置监听数-> ...

  4. eclipse卸载自带maven

    1.在eclipse的安装目录下,找到   features和plugins文件夹,删除这两个文件夹下maven对应的jar和文件夹(windows用户建议用如下搜索:*maven*和*m2e*) 2 ...

  5. 错误提示 nginx: [emerg] unknown directive "gzip_static"

    1.检查nginx配置文件错误提示如下: [root@server nginx]# /applications/nginx/sbin/nginx -t -c /applications/nginx/n ...

  6. springSecurity初步认识和执行流程

    springSecurity是spring官方给我们提供的一个非常强大的一个安全框架.也是现在最受欢迎的安全框架,比shiro更强大 springSecurity主要工作原理是内置了许多过滤器,组成过 ...

  7. 1.springboot:入门程序

    一.Spring Boot 简介 官网英文: Spring Boot makes it easy to create stand-alone, production-grade Spring base ...

  8. Redis 主从 keepalived高可用 实现 VIP 自动漂移

    Redis 多主写多从度 配置启动OK :直接配 keepalived  相关配置: redis 默认路径 :/usr/local/redis keepalived 默认路径 :/etc/keepal ...

  9. luogu P4160 [SCOI2009]生日快乐

    传送门 考虑因为每个人的蛋糕体积要相等,如果切了一刀,那么要使得分当前蛋糕的人根据分成的两部分蛋糕的体积分成两部分人,所以假设当前有n人,切的这一刀要是在x或y的\(\frac{k}{n}(k\in ...

  10. 2017CCPC秦皇岛 E题String of CCPC&&ZOJ3985【模拟】

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3985 题意: 给定一个字符串,由c和p组成,可以添加c或者p. 串中出现一 ...