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

    C. Multiplicity 题目链接:https://codeforc.es/contest/1061/problem/C 题意: 给出一串数,问它的“好序列“有多少.好序列的定义是,首先是一个子 ...

  2. 下拉列表JComboBox,列表框JList

    1.下拉列表JComboBox public class Demo extends JFrame { public Demo() { setBounds(100, 100, 200, 100); se ...

  3. STM32 --- 断言(assert_param)的开启和使用

    默认,STM32的assert_param是没有开启检测,需要 #define USE_FULL_ASSERT 开启后,才能检测形参是否符合要求 // #define assert_param(exp ...

  4. CodeForces701E DFS

    http://codeforces.com/problemset/problem/701/E 一个显而易见的方法是考虑点的贡献,一次dfs记录到所有根节点不考虑匹配的答案,再一次dfs反向推出答案 # ...

  5. HTML格式化标签

    除了div.p.h1~h6.a.span这几个极常用的标签外,HTML还有一些不常见的标签(10个,5对:加粗.斜体.大小.上下标.特殊),默认效果如下: 当然,我们习惯用css编写效果来替代这些效果 ...

  6. Hive记录-Hive调优

    1.Join优化 a.map join b.reduce join 小表为驱动表,或直接将小表加载到内存,做map端join,它的关键字为/*+MAP JOIN(t1)*/ 如果想自动开启map端Jo ...

  7. html 高亮显示表格当前行【转】

    html在线模拟网:http://www.w3school.com.cn/tiy/t.asp?f=html_basic 高亮显示表格当前行 <html> <head> < ...

  8. 006、容器 What、Why、How(2018-12-21 周五)

    参考https://www.cnblogs.com/CloudMan6/p/6751516.html   What - 什么是容器?       容器是一种轻量级.可移植.自包含的软件打包技术,是应用 ...

  9. C++ error LNK2001

    1.没有函数的实现部分 2.函数的头文件和实现部分不一致 3.缺库LIB.DLL 4.库H文件函数和库体不一致

  10. 使用jQuery实现返回顶部功能

    <p id="back-to-top"><a href="#top"><span></span>返回顶部< ...