操作系统:macOS High Sierra Version 10.13.4
Homebrew:1.6.4
brew doctor
确认brew在正常工作。brew update
更新包。brew install mysql
安装mysql。其中运行mysql_secure_installation 可以设置密码
运行brew service start mysql 可以后台启动mysql
运行mysql.server start 前台启动mysql(关闭控制台,服务停止)
5 按照brew的提示运行 mysql_secure_installation设置密码,运行后会报错:
> mysql_secure_installation
Securing the MySQL server deployment.
Enter password for user root:
Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
这个错误是因为MySQL服务还没启动
6、启动MySQL服务
mysql.server start
在我的机器上第一次没报错,以后运行此命令有可能会报权限错误。尝试修改权限但是最后还是不行,最后采用sudo启动解决此问题。
sudo mysql.server start
7、设置密码
mysql_secure_installation
如果报权限错误执行 sudo mysql_secure_installation
Securing the MySQL server deployment.
Connecting to MySQL using a blank password.
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: y
There are three levels of password validation policy:
LOW Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary file
// 这里提示选一个密码强度等级
Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 1
Please set the password for root here.
// 然后按照所选的密码强度要求设定密码
New password:
Re-enter new password:
Estimated strength of the password: 50
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
... Failed! Error: Your password does not satisfy the current policy requirements
New password:
Re-enter new password:
Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
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
Success.
Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.
// 禁止远程root登录,我选的是不禁止。因为我的mac上的数据库不会放到公网上,也不会存什么敏感数据
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : no
... skipping.
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.
// 这里删除默认自带的test数据库
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : 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? (Press y|Y for Yes, any other key for No) : y
Success.
All done!
8、连接MySQL
mysql -u root -p
最后特别注意启动方式的问题:
运行brew service start mysql 可以后台启动mysql
运行mysql.server start 前台启动mysql
如果提示权限问题使用sudo指令,我的笔记本上如果不加此指令各种权限问题。
Namespace 隔离设计命名空间(Namespace)用于进行租户粒度的隔离,Namespace 的常用场景之一是不同环境的隔离,例如开发测试环境和生产环境的资源(如配置、服务)隔离等。从一个租户(用户)的角度来看,如果有多套不同的环境,那么这个时候可以根据指定的环境来创建不同的namespce,以此来实现多环境的隔离。从多个租户(用户)的角度来看,每个租户(用户)可能会有自己的 namespace,每个租户(用户)的配置数据以及注册的服务数据都会归属到自己的 namespace 下,以此来实
1124: 两个有序数组合并Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 6010 Solved: 2174SubmitStatusWeb BoardDescription已知数组a中有m个按升序序排列的元素,数组b中有n个降序排列的元素,编程将a与b中的所有元素按降序存入数组c中。Input
首先得知道ESP8266的三种工作方式 AP模式 STA模式 AP+STA模式 可以这样来形象的理解三个工作模式 AP模式就仅仅相当于路由器功能可以发出信号。 当然我们知道路由器不仅仅能发出信号,当然可以接受信号的,所以就有了STA模式的基站功能就是接受信号。 接受完信号是不是还能广播出去呢?当然可以了!!所以就有了AP+STA模式的工作方式进行AP模
数据库碎片找回 ,专注数据库修复 餐饮 思迅软件 数据库修复 mdf数据库找回 2016年4月18日 广州 牛排餐厅 思迅误格式化 数据库碎片重组找回 今天接到思迅代理商打来电话,说客户因为电脑问题找当地的电脑维修人员把电脑格式化重新安装系统,磁盘有原来的6个区变成...
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。 ...
基于css + jQuery 配合 实现可悬停控制视频轮播代码。这是一款可悬停切换全屏轮播jQuery幻灯片。本例有四个视频,对应四个悬停按钮框与下方的文字简介 效果图如下:html 代码:<!DOCTYPE html><html><head> <title>视频轮播</title> <...
记者近日在各大房地产门户网站发现,“蚁族”与“蜗居”已经成为新的楼市流行词,被媒体以及各路专家采用。 北京中关村以北的唐家岭以低廉的生活成本吸引了大量大学毕业生群居,随着这一现象被曝光,“蚁族”则成为在京打拼的外地生源毕业生的代名词。而随着同名电视剧的播出,负债累累的房奴也被形象地称为“蜗居”。 幸运“蚁族”可“蜗居” 林晓(化名)是2004年北京某名牌...
为什么dubbo启动没有问题?这篇blog源于一个疑问:我们公司使了阿里的dubbo,但是阿里的开源网站http://code.alibabatech.com,挂掉有好几个月了,为什么我们的应用启动没有问题?我们的应用的Spring配置文件里有类似的配置:&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;beans xmlns="http://www....
文章目录一、Spring框架是什么?Spring框架特点二、Spring体系结构1.引入库2.读入数据总结一、Spring框架是什么?Spring 是另一个主流的 Java Web 开发框架,该框架是一个轻量级的应用框架,具有很高的凝聚力和吸引力。Spring 具有简单、可测试和松耦合等特点,不仅可以用于服务器端的开发,也可以应用于任何 Java 应用的开发中Spring 是分层的 Java SE/EE full-stack 轻量级开源框架,以 IoC(Inverse ofControl,控制
Android Studio是采用gradle来构建项目的,gradle是基于groovy语言的,如果只是用它构建普通Android项目的话,是可以不去学groovy的。当我们创建一个Android项目时会包含两个Android build.gradle配置详解文件,如下图:一、Project的build.gradle文件:对应的build.gradle代码如下:// To...
1,引入依赖<dependency> <groupId>com.github.wxpay</groupId> <artifactId>wxpay-sdk</artifactId> <version>0.0.3</version> </dependency> <dependency>
外出游玩拍照已经是必不可以少的一项程序,记下美好的瞬间,回到家中,可以与家人一起分享,每个照片背后都是一个小故事,那如果全家很多人想一起浏览这些照片怎么办呢?不会只是想通过家庭群吧!那对于一些年龄稍长的人来说是不会操作的,此时是不是都会想到将小小的手机屏幕上的内容在电脑上展示出来,奈何又不会操作,其实很简单,特别是对苹果,因为镜像投屏功能的支持,那如何将苹果手机投屏到电脑中呢?使用工具:迅捷苹果...