非常好 强力推荐

这个是我最新并且一直推崇的方法:
1、安装:sunyichaodeMacBook-Pro:~ sunyichao$ brew install mysql
2、开启mysql:mysql.server start
2、使用mysql的配置脚本:/usr/local/opt/mysql/bin/mysql_secure_installation //mysql 提供的配置向导
启动这个脚本后,即可根据如下命令提示进行初始化设置

sunyichaodeMacBook-Pro:~ sunyichao$ /usr/local/opt/mysql/bin/mysql_secure_installation   //mysql 提供的配置向导
Securing the MySQL server deployment.
Connecting to MySQL using a blank password.
VALIDATE PASSWORD PLUGIN can be used to test passwordsand 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: k //是否采用mysql密码安全检测插件(这里作为演示选择否,密码检查插件要求密码复杂程度高,大小写字母+数字+字符等)
Please set the password for root here. // 首次使用自带配置脚本,设置root密码 New password: Re-enter new password: By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for 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? [Y/n] Y //是否删除匿名用户
... Success! 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? [Y/n] Y //是否禁止远程登录
... Success! 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? [Y/n] Y //删除测试数据库,并登录
Dropping test database...
... Success!
Removing privileges on test database...
... Success! Reloading the privilege tables will ensure that all changes made so far
will take effect immediately. Reload privilege tables now? [Y/n] Y//重新载入权限表
... Success! All done! If you've completed all of the above steps, your MySQL
installation should now be secure. Thanks for using MySQL! Cleaning up...
sunyichaodeMacBook-Pro:~ sunyichao$

Mac 命令行安装mysql homebrew 安装mysql后,如何配置mysql的更多相关文章

  1. 【转载】【Centos linux系统】命令行(静默)安装oracle 11gR2

    [原文]:http://blog.chinaunix.net/uid-23886490-id-3565998.html 一.安装前准备 1.内存及swap要求 至于swap如何添加,后文将提到 gre ...

  2. 【Centos linux系统】命令行(静默)安装oracle 11gR2

    一.安装前准备 1.内存及swap要求 至于swap如何添加,后文将提到 1 2 grep MemTotal /proc/meminfo grep SwapTotal /proc/meminfo 2. ...

  3. Scoop - 在Windows命令行上进行程序安装

    2019-01-28  22:49:21 资料来源自Scoop官方网站以及github上的帮助文档 如果有疑惑或者觉得文章有错误请留言以帮助改正 补充内容(2019-04-09 21:11:36):不 ...

  4. 【转载】基于Linux命令行KVM虚拟机的安装配置与基本使用

    基于Linux命令行KVM虚拟机的安装配置与基本使用 https://alex0227.github.io/2018/06/06/%E5%9F%BA%E4%BA%8ELinux%E5%91%BD%E4 ...

  5. mac命令行配置网络

    mac命令行配置网络今天终于找到了Mac OS X通过命令行修改ip的方式了,记录如下: 修改mac地址,重启后失效sudo ifconfig en0 lladdr d0:67:e5:2e:07:f1 ...

  6. Appium Mac 命令行安装

    试过很多方法都失败,打算用命令行方式安装. 准备工作: 从 https://github.com/appium/appium下载appium版本的源码(.tar) 详见github_Appium1.6 ...

  7. mac 命令行安装软件

    第一步需要在mac上安装brew工具 ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/mas ...

  8. MAC 命令行工具(Command Line Tools)安装

    不过升级后安装命令行工具(Command Line Tools)时发现官网没有clt的下载安装包了,原来改了,使用命令在线安装. 打开终端,输入命令:xcode-select --install 选择 ...

  9. Ubuntu安装Wildfly(原JBoss)并为其配置MySQL分布式数据源

    注:JBoss在8.0版本后改名为WildFly,以JBoss命名的版本最高为7.1.1.Final,但JBoss7.1.1.Final不支持jdk1.8以上版本,如果在jdk1.8情况下安装JBos ...

随机推荐

  1. js输出指定n位数的随机数的随机整数方法【转发】

    /** * Description:[输出指定n位数的随机数的随机整数] * * @param n 指定n位数 * */ function RndNum(n) { var rnd = "&q ...

  2. shell之“>/dev/null 2>&1”

    shell之“>/dev/null 2>&1” http://ixdba.blog.51cto.com/2895551/526442 今天在自己的一个技术群中又被问道了这么一个问题 ...

  3. C++开发安卓、windows下搭建Android NDK开发环境

    1. NDK(Native Development Kit) 1.1 NDK简介 Android NDK是一套允许开发人员使用本地代码(如C/C++)进行Android APP功能开发的工具,通过这个 ...

  4. CSS3饼状loading效果

    概述 之前看到很多饼状loading效果是用图片的方式实现的,本例子采用的是纯CSS3实现,这样可以节省资源空间,有兴趣的小伙伴可以看下~ 详细 代码下载:http://www.demodashi.c ...

  5. 更安全的HTTPS

    iOS9把所有的http请求都改为https了:iOS9系统发送的网络请求将统一使用TLS 1.2 SSL.采用TLS 1.2 协议,目的是 强制增强数据访问安全,而且 系统 Foundation 框 ...

  6. 【LeetCode】135. Candy

    Candy There are N children standing in a line. Each child is assigned a rating value. You are giving ...

  7. 配置tomcat全局c3p0连接池

    由于项目中多个应用访问同一个数据库,并部署在同一个tomcat下面,所以没必要每个应用都配置连接池信息,这样可能导致数据库的资源分布不均,所以这种情况完全可以配置一个tomcat的全局连接池,所涉及应 ...

  8. Python练习笔记——编写一个阶乘函数

    当输入一个数字时,函数自动计算该数的 阶乘 def factorial(num): j = 1 for i in range(1,num+1): j = j*i print(j) num = int( ...

  9. pcurl 学习 http文件下载及写入空设备文件实例

    import pycurl import sys import os import random import string import time class Transaction(object) ...

  10. PLSQL_数据结构类型的解析(概念)

    2014-06-02 Created By BaoXinjian