记一下mysql安装过程中遇到的报错解决
这里主要是我的需求不高,没必要非得高版本,我的系统硬件很低,如有需求,可以选择docker部署。然后,发现低版本对这些包要求不高,所以选择了降版本到5.7,好使…需要安装升级响应库,比较麻烦,暂时没试。
·
执行mysql8.0.34安装过程中的:bin/mysqld --initialize --user=mysql 步骤时报错。
报错1:bin/mysqld: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory
解决:
centos:yum install numactl
ubuntu:apt-get install numactl
报错2:
bin/mysqld: /lib64/libstdc++.so.6: version `CXXABI_1.3.11' not found (required by bin/mysqld)
bin/mysqld: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by bin/mysqld)
bin/mysqld: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by bin/mysqld)
bin/mysqld: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by bin/mysqld)
bin/mysqld: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by bin/mysqld)
bin/mysqld: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by bin/mysqld)
bin/mysqld: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by bin/mysqld)
bin/mysqld: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by /project/mysql-8.0.33-linux-glibc2.28-x86_64/bin/../lib/private/libcrypto.so.1.1)
bin/mysqld: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /project/mysql-8.0.33-linux-glibc2.28-x86_64/bin/../lib/private/libprotobuf-lite.so.3.19.4)
bin/mysqld: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /project/mysql-8.0.33-linux-glibc2.28-x86_64/bin/../lib/private/libprotobuf-lite.so.3.19.4)
bin/mysqld: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /project/mysql-8.0.33-linux-glibc2.28-x86_64/bin/../lib/private/libprotobuf-lite.so.3.19.4)
bin/mysqld: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /project/mysql-8.0.33-linux-glibc2.28-x86_64/bin/../lib/private/libprotobuf-lite.so.3.19.4)
bin/mysqld: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /project/mysql-8.0.33-linux-glibc2.28-x86_64/bin/../lib/private/libprotobuf-lite.so.3.19.4)
解决:
感谢: https://blog.csdn.net/qilaixiaoboluo/article/details/136381545
需要安装升级响应库,比较麻烦,暂时没试
然后,发现低版本对这些包要求不高,所以选择了降版本到5.7,好使…emo…
这里主要是我的需求不高,没必要非得高版本,我的系统硬件很低,如有需求,可以选择docker部署
执行mysql5.7.44安装过程中的:bin/mysqld_safe --user=mysql & 步骤时报错。
某些文件不存在等
[2] 13323
(base) [root@VM-0-16-centos mysql]# 2024-03-15T05:56:31.855167Z mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
2024-03-15T05:56:31.888640Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2024-03-15T05:56:32.359648Z mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
其实这些,自己指定个路径就行了
/usr/local/mysql/bin/mysqld \
--basedir=/usr/local/mysql \
--datadir=/var/lib/mysql \
--plugin-dir=/usr/local/mysql/lib/plugin \
--user=mysql \
--log-error=/var/log/mariadb/mariadb.log \
--pid-file=/var/run/mariadb/mariadb.pid \
--socket=/var/lib/mysql/mysql.sock
上面的路径都可以自定义,我就是懒得定义,那么出问题的目录都是因为权限不够
解决:
mkdir -p /var/log/mariadb
touch /var/log/mariadb/mariadb.log
chmod 777 -R /var/log/mariadb/
chown mysql:mysql -R /var/log/mariadb/ # 可不执行
服务启动,然后进入mysql时:./bin/mysql -uroot -p
报错:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
解决:
# 简单方案
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
完整方案:感谢:https://blog.csdn.net/web_15534274656/article/details/126493970
更多推荐
已为社区贡献16条内容
所有评论(0)