博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Solaris11.3安装MySQL5.7.23遇到libstdc++.so.6报错(GLIBCXX_3.4.20)
阅读量:6687 次
发布时间:2019-06-25

本文共 5347 字,大约阅读时间需要 17 分钟。

错误如下:

root@solaris:/usr/local/mysql# /usr/local/mysql/bin/mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --initializeld.so.1: mysql: fatal: libCrunG3.so.1: open failed: No such file or directoryKilled

ldd命令查看mysqld执行所需要的库文件

root@solaris:/usr/local/mysql# ldd /usr/local/mysql/bin/mysqld        libstdc++.so.6 =>        /usr/lib/64/libstdc++.so.6        libstdc++.so.6 (GLIBCXX_3.4.20) =>       (version not found)        libgcc_s.so.1 =>         /usr/lib/64/libgcc_s.so.1        libCrunG3.so.1 =>        (file not found)        libc.so.1 =>     /lib/64/libc.so.1        libmtmalloc.so.1 =>      /usr/lib/64/libmtmalloc.so.1        libsocket.so.1 =>        /lib/64/libsocket.so.1        libnsl.so.1 =>   /lib/64/libnsl.so.1        libm.so.2 =>     /lib/64/libm.so.2        librt.so.1 =>    /lib/64/librt.so.1        libatomic.so.1 =>        /usr/lib/64/libatomic.so.1        libmp.so.2 =>    /lib/64/libmp.so.2        libucrypto.so.1 =>       /lib/64/libucrypto.so.1        libpthread.so.1 =>       /lib/64/libpthread.so.1        libelf.so.1 =>   /lib/64/libelf.so.1        libcryptoutil.so.1 =>    /lib/64/libcryptoutil.so.1        libz.so.1 =>     /lib/64/libz.so.1

可以看到Solaris11.3中libstdc++.so.6是一个link文件

ls -l /usr/lib/64/libstdc++.so.6lrwxrwxrwx   1 root     root          19 Oct 17 17:45 /usr/lib/64/libstdc++.so.6 -> libstdc++.so.6.0.18

这个问题我也卡了很久,没找到有效资料,string libstdc++.so.6.0.18 | grep GLIBCXX 这条命令并不适用Solaris11.3

可以用pvs命令查看库文件

root@solaris:/usr/local/mysql# pvs /usr/lib/64/libstdc++.so.6.0.18         libm.so.2 (SUNW_1.2);        libc.so.1 (SUNW_1.22, SUNWprivate_1.1);        libgcc_s.so.1 (GCC_4.2.0);        libstdc++.so.6;        GLIBCXX_3.4;        GLIBCXX_3.4.1;        GLIBCXX_3.4.2;        GLIBCXX_3.4.3;        GLIBCXX_3.4.4;        GLIBCXX_3.4.5;        GLIBCXX_3.4.6;        GLIBCXX_3.4.7;        GLIBCXX_3.4.8;        GLIBCXX_3.4.9;        GLIBCXX_3.4.10;        GLIBCXX_3.4.11;        GLIBCXX_3.4.12;        GLIBCXX_3.4.13;        GLIBCXX_3.4.14;        GLIBCXX_3.4.15;        GLIBCXX_3.4.16;        GLIBCXX_3.4.17;        GLIBCXX_3.4.18;        GLIBCXX_3.4.19;        CXXABI_1.3;        CXXABI_1.3.1;        CXXABI_1.3.2;        CXXABI_1.3.3;        CXXABI_1.3.4;        CXXABI_1.3.5;        CXXABI_1.3.6;        CXXABI_1.3.7;        CXXABI_TM_1;

可以看到确实没有GLIBCXX_3.4.20版本

解决办法:

编译安装gcc4.9,过程就不在这里写了,我直接用的原来编译好的tar包,然后用gcc里面的库文件代替libstdc++.so.6.0.18,过程如下

root@solaris:~# mkdir /usr/gccroot@solaris:~# tar -xf gcc4.9.tar.gz root@solaris:~# mv 4.9 /usr/gcc/root@solaris:~# mv /usr/lib/64/libstdc++.so.6 /usr/lib/64/libstdc++.so.6.bakroot@solaris:~# ln -s /usr/gcc/4.9/lib/amd64/libstdc++.so.6.0.20 /usr/lib/64/libstdc++.so.6

此时ldd查看

root@solaris:/usr/local/mysql# ldd ./bin/mysqld        libstdc++.so.6 =>        /usr/lib/64/libstdc++.so.6        libgcc_s.so.1 =>         /usr/lib/64/libgcc_s.so.1        libCrunG3.so.1 =>        (file not found)        libc.so.1 =>     /lib/64/libc.so.1        libmtmalloc.so.1 =>      /usr/lib/64/libmtmalloc.so.1        libsocket.so.1 =>        /lib/64/libsocket.so.1        libnsl.so.1 =>   /lib/64/libnsl.so.1        libm.so.2 =>     /lib/64/libm.so.2        librt.so.1 =>    /lib/64/librt.so.1        libatomic.so.1 =>        /usr/lib/64/libatomic.so.1        libpthread.so.1 =>       /lib/64/libpthread.so.1        libmp.so.2 =>    /lib/64/libmp.so.2        libucrypto.so.1 =>       /lib/64/libucrypto.so.1        libelf.so.1 =>   /lib/64/libelf.so.1        libcryptoutil.so.1 =>    /lib/64/libcryptoutil.so.1        libz.so.1 =>     /lib/64/libz.so.1

GLIBCXX的问题解决了,但是又提示libCrunG3.so.1找不到,把文件拷贝到/usr/lib/64/下

root@solaris:/usr/local/mysql# cp /root/libCrunG3.so.1  /usr/lib/64/

此时ldd mysqld已经没有报错,可以开始初始化

root@solaris:~# /usr/local/mysql/bin/mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --initialize2018-10-17T10:41:29.143880Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).2018-10-17T10:41:34.828810Z 0 [Warning] InnoDB: New log files created, LSN=457902018-10-17T10:41:35.756604Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.2018-10-17T10:41:35.840912Z 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: 386b2928-d1f9-11e8-9e9b-9e1aa5f0c1f7.2018-10-17T10:41:35.843805Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.2018-10-17T10:41:35.845870Z 1 [Note] A temporary password is generated for root@localhost: L9!TrOyPaiiSroot@solaris:/usr/local/mysql# ./support-files/mysql.server start Starting MySQL.Logging to '/usr/local/mysql/data/solaris.err'.. SUCCESS!root@solaris:/usr/local/mysql# /usr/local/mysql/bin/mysql -uroot -p'L9!TrOyPaiiS'mysql: [Warning] Using a password on the command line interface can be insecure.Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 2Server version: 5.7.23Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>

启动过程可能还会遇到其他问题,这里就不写了

转载地址:http://qfeao.baihongyu.com/

你可能感兴趣的文章
《豆瓣的基础架构》
查看>>
运算符 and or ont
查看>>
Android 解决setRequestedOrientation之后手机屏幕的旋转不触发onConfigurationChanged方法...
查看>>
[Android Pro] Android权限设置android.permission完整列表
查看>>
headfirst设计模式(6)—单例模式
查看>>
地图坐标服务
查看>>
focus()无效问题
查看>>
python ConfigParser 学习
查看>>
JS 判断中英文字符长度
查看>>
小程序模板
查看>>
raw deferreds vs deferredGenerator vs inlineCallbacks
查看>>
Python中四种样式的99乘法表
查看>>
对于快速排序算法的递归栈深度的一点改进
查看>>
模拟锁定文件
查看>>
矩阵乘法2(codevs3147)
查看>>
如何修复Kindle频繁自动锁屏和解锁
查看>>
Sicily 4190. Prime Palindromes 解题报告
查看>>
MongoDB在Windows下安装配置
查看>>
CAFFE安装(3):cuDNN v4
查看>>
hdu 1016 Prime Ring Problem
查看>>