Hive报错记录
报错1:
[hyj@hadoop102 hive-3.1.2]$ sudo mysqld --initialize --user=mysql
我在此步出现了以下错误:
2022-05-22T08:44:45.327711Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2022-05-22T08:44:45.327928Z 0 [ERROR] Error message file '/usr/share/mysql/english/errmsg. sys' had only 1080 error messages,
but it should contain at least 1120 error messages.
Check that the above file is the right version for this program!
2022-05-22T08:44:45.329400Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2022-05-22T08:44:45.329418Z 0 [ERROR] Aborting
第一种错误(2022-05-22T08:44:45.327711Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details) 的解决方法:
在/etc/my.cnf文件中加上explicit_defaults_for_timestamp=true保存后就可以了.
第二种错误(2022-05-22T08:44:45.327928Z 0 [ERROR] Error message file ‘/usr/share/mysql/english/errmsg. sys’ had only 1080 error messages,
but it should contain at least 1120 error messages.
Check that the above file is the right version for this program!)的解决方法为:
- 先去官网下载mysql-5.7.29-linux-glibc2.12-x86_64.tar.gz(下载对应版本的)
官网下载地址:https://downloads.mysql.com/archives/community/ - 将mysql-5.7.29-linux-glibc2.12-x86_64.tar.gz上传到/opt/software目录下
- 将mysql-5.7.29-linux-glibc2.12-x86_64.tar.gz解压到当前目录下
将mysql安装目录下的share/english/errmsg.sys 文件覆盖 /usr/share/mysql/english/errmsg.sys文件即可
[hyj@hadoop102 software]$ tar -zxvf mysql-5.7.29-linux-glibc2.12-x86_64.tar.gz
[hyj@hadoop102 software]$ cd mysql-5.7.29-linux-glibc2.12-x86_64/
[hyj@hadoop102 mysql-5.7.29-linux-glibc2.12-x86_64]$ cd share/english/
[hyj@hadoop102 english]$ ls
errmsg.sys
[hyj@hadoop102 english]$ sudo mv /usr/share/mysql/english/errmsg.sys /usr/share/mysql/english/errmsg.bak
[hyj@hadoop102 english]$ sudo cp errmsg.sys /usr/share/mysql/english/
[hyj@hadoop102 english]$ cd /opt/software
[hyj@hadoop102 software]$ rm -fr mysql-5.7.29-linux-glibc2.12-x86_64 mysql-5.7.29-linux-glibc2.12-x86_64.tar.gz
最后再重新初始化数据库就可以了.