manjaro 安转mysql8.0.15

1. 安装

yay -S mysql

2. 初始化

sudo mysqld --initialize --user=mysql --basedir=/usr --datadir=/var/lib/mysql

遇到问题:

mysqld: error while loading shared libraries: libicuuc.so.63: cannot open shared object file: No such file or directory

问题解决参考:https://www.jianshu.com/p/a7f1f2f5c1c5

错误原因 : 系统升级到最新之后所依赖的icu包已经更新到64 ,而mysql需要用到的是63版本.

解决办法 

下载http://download.icu-project.org/files/icu4c/63.1/icu4c-63_1-src.tgz

解压之后编译(建议最好不要安装,可能会出现其他问题)

cd source 

./configure --prefix=/usr          

make

等待编译完成之后  进入 source/lib目录

拷贝 libicuuc.so.63   libicui18n.so.63 libicudata.so.63文件到/usr/lib/目录下即可

cp libicuuc.so.63*  /usr/lib

cp libicui18n.so.63* /usr/lib

cp libicudata.so.63* /usr/lib

重新执行初始化脚本,成功执行

2019-05-30T07:34:22.366588Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2019-05-30T07:34:22.377141Z 0 [System] [MY-013169] [Server] /usr/bin/mysqld (mysqld 8.0.15) initializing of server in progress as process 23892
2019-05-30T07:34:53.057758Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: #-cy_Ogti8iu
2019-05-30T07:35:08.260384Z 0 [System] [MY-013170] [Server] /usr/bin/mysqld (mysqld 8.0.15) initializing of server has completed

3. 启动

systemctl start mysqld

4. 修改root密码

mysql -uroot -p#-cy_Ogti8iu

ALTER user 'root'@'localhost' IDENTIFIED BY 'Mysql@2019'; 

其中Mysql@2019为新的root密码

©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页