mysql8之坑
一、具体"坑"
1、修改密码和修改加密方式
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '新密码' PASSWORD EXPIRE NEVER;
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '新密码';
mysql> FLUSH PRIVILEGES;
2、默认表名不区分大小写
二、区别于其他版本的安装方式
1、在初始化数据库(生成data文件夹)之前新建my.ini文件在mysql的安装目录,内容如下:
[mysqld] # basedir=C:\mysql-8.0.17-winx64 # datadir=C:\mysql-8.0.17-winx64\data # sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES port=3306 character-set-server=utf8mb4 collation-server=utf8mb4_0900_ai_ci # 设置协议认证方式(重点啊) default_authentication_plugin=mysql_native_password # 大小写敏感,lower_case_table_names=1是不敏感 lower_case_table_names=2 [client] default-character-set=utf8mb4 [mysql] default-character-set=utf8mb4