一、打开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. selenium - switch_to.window() - 多窗口切换

    在页面操作过程中有时候点击某个链接会弹出新的窗口,这时就需要主机切换到新打开的窗口上进行操作.WebDriver提供了switch_to.window()方法,可以实现在不同的窗口之间切换. 以百度首 ...

  2. shell 备份代码

    #!/bin/sh # 备份代码 basedir=/data/backup www_src=$basedir/$(date +%F_$H) [ ! -d "$www_src" ] ...

  3. 【CSS】定义元素的对齐方式

    1.文本内容居中对齐:text-align.扩展用法:父元素嵌套子元素时,且子元素的宽度小于父元素宽度,使用text-align:center,可以实现子元素的居中对齐. <!DOCTYPE h ...

  4. CodeForces912E 折半+二分+双指针

    http://codeforces.com/problemset/problem/912/E 题意·n个质数,问因子中只包含这其中几个质数的第k大的数是多少 最显然的想法是暴力搜预处理出所有的小于1e ...

  5. Hibernate_事务管理

    今天学习Hibernate,发现当我在执行下面操作时,不会对数据库产生任何效果,就是说Customer对象并不会保存到数据库中 Session session = HibernateUtils.ope ...

  6. 一张图看懂JavaScript中数组的迭代方法:forEach、map、filter、reduce、every、some

    好吧,竟然不能单发一张图,不够200字啊不够200字! 在<JavaScript高级程序设计>中,分门别类介绍了非常多数组方法,其中迭代方法里面有6种,这6种方法在实际项目有着非常广泛的作 ...

  7. vs2017_enterprise正式版离线安装包bt下载

    vs2017_enterprise正式版离线安装包bt下载 点击这里下载种子 磁力链接 安装前请先打开certificates目录,安装里面的三个证书 离线下载教程 : https://docs.mi ...

  8. Log4j Threshold属性指定输出等级

    有时候我们需要把一些报错ERROR日志单独存到指定文件 ,这时候,Threshold属性就派上用场了: Threshold属性可以指定日志level Log4j根据日志信息的重要程度,分OFF.FAT ...

  9. Catfish CMS漏洞集合

    转自https://larryxi.github.io/ 0x00 背景 版本:V 4.2.35 官网下载:http://www.catfish-cms.com/page/4.html 文章内容仅作学 ...

  10. linux僵尸进程产生的原因以及如何避免产生僵尸进程

    给进程设置僵尸状态的目的是维护子进程的信息,以便父进程在以后某个时间获取.这些信息包括子进程的进程ID.终止状态以及资源利用信息(CPU时间,内存使用量等等).如果一个进程终止,而该进程有子进程处于僵 ...