本文已参与「新人创作礼」活动,一起开启掘金创作之路。
MySQL安装文件为 mysql-5.7.28-linux-glibc2.12-x86_64.tar.gz,阿里云和腾讯云的Linux环境不完全相同,安装时出现了意想不到的问题,这种问题不大,搜索一些就能解决,这里记录一下。
1.报错
输入初始化命令后报错
cd /usr/local/mysql
bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql/data
error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory
2.解决
# yum 安装的libnuma.so.1,但安装时默认安装的是32的,但db2需要的是64位的
yum remove libnuma.so.1
yum -y install numactl.x86_64
再次初始化后成功
cd /usr/local/mysql
bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql/data
2021-03-30T10:18:25.212584Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-03-30T10:18:26.237192Z 0 [Warning] InnoDB: New log files created, LSN=45790
2021-03-30T10:18:26.356956Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2021-03-30T10:18:26.459079Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 43fe917f-9141-11eb-a515-00163e3019ff.
2021-03-30T10:18:26.460035Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2021-03-30T10:18:27.546222Z 0 [Warning] CA certificate ca.pem is self signed.
2021-03-30T10:18:28.087215Z 1 [Note] A temporary password is generated for root@localhost: +oUisNmwk6:e
3.再次报错
启动时报错
/etc/init.d/mysqld start
Starting MySQL.Logging to '/data/mysql/data/tcloud.err'.
.. ERROR! The server quit without updating PID file (/data/mysql/data/tcloud.pid).
查看log文档,发现是3306被占用,杀掉占用进程后启动成功,遇到问题看日志,问题可能跟我不同。