Spring Boot实战【mysql安装】

mysql官网下载mysql-5.7.19-macos10.12-x86_64.dmg【个人用mac本,所以教程也暂时对mac有效】。

下载好后,点击dmp文件,加载完成后会看到这个图。

Spring Boot实战【mysql安装】

双击安装,如下图 就比较熟悉了。

Spring Boot实战【mysql安装】

=默认下一步 完成安装即可=

完成安装会显示以下这段文案(记下密码):【2017-07-28T02:50:29.113533Z 1 [Note] A temporary password is generated for [email protected]: 7d(8N57eb5A+


If you lose this password, please consult the section How to Reset the Root Password in the MySQL reference manual.

>用本地SequelPro登录。如图

Spring Boot实战【mysql安装】

>直接点击会提示 连接不上 如图

Spring Boot实战【mysql安装】

>具体原因分析:

1、没有启动mysql服务:如图执行(sudo /usr/local/mysql/support-files/mysql.server start)启动服务

Spring Boot实战【mysql安装】

2、无法识别 mysql命令:(如上图显示)把mysql命令路径添加到环境变量中(如下图所示:export PATH=$PATH:/usr/local/mysql/bin)

Spring Boot实战【mysql安装】

3、命令行登录如上图所示:输入命令mysql -uroot -p 后再输入密码。见Welcome to the MySQL monitor 表示登录成功。

4、登录成功 却操作不了。看提示 要求先修改密码(如下图)

Spring Boot实战【mysql安装】

5、修改密码:执行命令 set password=password('root'); 如下图所示:表示修改成功 

Spring Boot实战【mysql安装】

6、用户客户端修改密码为root再次登录:成功。


7、创建数据库

Spring Boot实战【mysql安装】