debian10 buster mysql8 Can't find error-message file '/usr/share/mysql/errmsg.sys'
更新到最新的mysql8 后, 启动报错
[ERROR] [MY-010338] [Server] Can’t find error-message file ‘/usr/share/mysql/errmsg.sys’. Check error-message file location and ‘lc-messages-dir’ configuration directive.
检查了 /etc/mysql/my.cnf 链接到的mysql.cnf
lc-messages-dir = /usr/share/mysql
mysql8 已经变成了
/usr/share/mysql-8.0
所以修改下
lc-messages-dir = /usr/share/mysql-8.0
然后重启mysql就行了
同理mysql 8 废弃了一些参数, 比如sql_mode的ONLY_FULL_GROUP
sql_mode='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION' #deprecate 8.0
现在需要去掉
sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'
另外mysql8 把以前授权创建用户一条命令的grant 拆分成了2条
create user 'root'@'%' identified by 'you_password';grant all privileges on *.* to 'root'@'%' with grant option;flush privileges;