二进制安装mysql 报error while loading shared libraries: libtinfo.so.5 解决办法

MySQL 采用的是 Linux- Generic 包安装,但是到了连接服务的时候却报错了

[root@cent8_yzil ~]# mysql -uroot -p'&PwwRouFA29l'
mysql: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory


解决方法:

 ln -s /usr/lib64/libtinfo.so.6.1 /usr/lib64/libtinfo.so.5
 

[root@cent8_yzil ~]# mysql -uroot -p'&PwwRouFA29l'
mysql: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory

[root@cent8_yzil ~]# ln -s /usr/lib64/libtinfo.so.6.1 /usr/lib64/libtinfo.so.5
[root@cent8_yzil ~]# mysql -uroot -p'&PwwRouFA29l'
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 8
Server version: 8.0.23

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

mysql报服务启动没问题,查看状态起不来

[root@cent8_yzil ~]# systemctl start mysqld
[root@cent8_yzil ~]# systemctl status mysqld
● mysqld.service - MySQL Server
   Loaded: loaded (/etc/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2021-05-11 20:54:42 EDT; 5s ago
  Process: 3040 ExecStart=/app/mysql/bin/mysqld --defaults-file=/etc/my.cnf (code=exited, status=1/FAILURE)
 Main PID: 3040 (code=exited, status=1/FAILURE)

May 11 20:54:42 cent8_yzil.example.com systemd[1]: Started MySQL Server.
May 11 20:54:42 cent8_yzil.example.com mysqld[3040]: mysqld: [Warning] World-writable config file '/etc/my.cnf' is ignored.
May 11 20:54:42 cent8_yzil.example.com mysqld[3040]: 2021-05-12T00:54:42.514402Z 0 [System] [MY-010116] [Server] /app/mysql/bin/mysqld (mysqld 
May 11 20:54:42 cent8_yzil.example.com mysqld[3040]: 2021-05-12T00:54:42.631723Z 1 [ERROR] [MY-011011] [Server] Failed to find valid data direc
May 11 20:54:42 cent8_yzil.example.com mysqld[3040]: 2021-05-12T00:54:42.631947Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization 
May 11 20:54:42 cent8_yzil.example.com mysqld[3040]: 2021-05-12T00:54:42.632020Z 0 [ERROR] [MY-010119] [Server] Aborting
May 11 20:54:42 cent8_yzil.example.com mysqld[3040]: 2021-05-12T00:54:42.634467Z 0 [System] [MY-010910] [Server] /app/mysql/bin/mysqld: Shutdow
May 11 20:54:42 cent8_yzil.example.com systemd[1]: mysqld.service: Main process exited, code=exited, status=1/FAILURE
May 11 20:54:42 cent8_yzil.example.com systemd[1]: mysqld.service: Failed with result 'exit-code'.

初始化有问题,在重新初始化

[root@cent8_yzil ~]# rm -rf /data/mysql/*
[root@cent8_yzil ~]# rm -rf /etc/my.cnf 
[root@cent8_yzil ~]# mysqld --initialize --user=mysql --basedir=/app/mysql --datadir=/data/mysql
2021-05-12T00:59:27.901998Z 0 [System] [MY-013169] [Server] /app/mysql/bin/mysqld (mysqld 8.0.23) initializing of server in progress as process
2021-05-12T00:59:27.926549Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-05-12T00:59:28.691429Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-05-12T00:59:30.002641Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: )Ivmo3VcDIe.
[root@cent8_yzil ~]# vi /etc/my.cnf
[root@cent8_yzil ~]# systemctl enable mysqld
[root@cent8_yzil ~]# systemctl start mysqld
[root@cent8_yzil ~]# systemctl status mysqld
● mysqld.service - MySQL Server
   Loaded: loaded (/etc/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2021-05-11 21:02:31 EDT; 4min 19s ago
 Main PID: 3387 (mysqld)
    Tasks: 38 (limit: 11251)
   Memory: 348.3M
   CGroup: /system.slice/mysqld.service
           └─3387 /app/mysql/bin/mysqld --defaults-file=/etc/my.cnf

May 11 21:02:31 cent8_yzil.example.com systemd[1]: Started MySQL Server.
[root@cent8_yzil ~]# 

 

评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

y_zilong

一分钱的肯定

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值