MySql 配置出错信息-集锦

Initialization of the server's UUID failed because it could not be read from the auto.cnf file. If this is a new server, the initialization failed because it was not possible to generate a new UUID.

解决:
mv  auto.cnf auto.cnf.back # 备份配置文件
/etc/init.d/mysql start # 重启服务器

问题:

[ERROR] [MY-011011] [Server] Failed to find valid data directory.
2019-01-16T02:03:14.048226Z 0
[ERROR] [MY-010020] [Server] Data Dictionary initialization failed.

解决:
在8.0后 不需要手动创建 data 目录,会自动创建

问题:

[Warning] [MY-010091] [Server] Can't create test file /data/server/mysql-8.0.12/data/localhost.lower-test
[Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /data/server/mysql-8.0.12/data/ is case insensitive
[ERROR] [MY-010172] [Server] failed to set datadir to /data/server/mysql-8.0.12/data/
[ERROR] [MY-010119] [Server] Aborting

解决:
还好手动敲命令吧,复制命令。。。的坑,好大

错误:
[ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
[ERROR] [MY-010119] [Server] Aborting

解决:
数据目录已有文件存在,不能初始化,删除后就好

问题:
mysql> alter user 'yourshadow'@'192.168.56.%' identified with mysql_native_password;
ERROR 1396 (HY000): Operation ALTER USER failed for 'yourshadow'@'192.168.56.%'

解决:
名字与主机名要一致,如果不存在这样的用户,则直接报错

问题:
SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client

分析:这是在8.0版本后,用户的密码加密规则修改了,需要修正,如下方法修改为之前的加密方式

解决:
alter user 'yourshadow'@'%' identified with mysql_native_password by '123456';