目录
一.下载MySql8.0
二.安装MySql8.0
三.更新MySQL环境变量
1.编辑./.bash_profile文件
2.保存并退出vim
3.重新加载配置文件并生效
四.MySql8.0启动、停止、查看状态命令
五.启动MySql8.0
遇到错误了
解决办法:
六.验证MySQL8.0安装是否成功
地址:https://dev.mysql.com/downloads/mysql/
这次配置使用【强密码加密】。由于MySql8.0修改了加密方式,所以我们就用新的方式。
以后与Python3对接中可能会遇到因加密问题引起的错误,所以为了展现错误,才使用这个配置。
安装完成。
vim编辑器使用自行搜索
查看MySql启动状态
命令:sudo mysql.server status执行查看MySql状态命令后出现报错:
服务启动成功。
执行如下命令:
#连接本地MySql命令 aije@bogon ~ % mysql -u root -p Enter password: 这个密码是你数据库的管理密码 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 9 #当前版本为8.0.20 Server version: 8.0.20 MySQL Community Server - GPL Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. #查询当前存在的数据库 mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.00 sec) #退出MySQL命令行 mysql> exit; Bye aije@bogon ~ %至此MySQL8.0安装完成。
其他关于MySql数据库知识请自行学习。推荐个地址:https://www.runoob.com/mysql/mysql-tutorial.html