记一次mysql 命令行登录报错(error while loading shared libraries: libssl.so.1.1)

mysql 命令行登录报错
故障现象:
$ mysql
mysql: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

导致本地无法登陆

解决方案:
原因:

机器没有找到这个文件 libssl.so.1.1

方法1.重新安装

yum -y install libaio

方法2 。从别的正常机器上拷贝文件过去
###@ctos7.6[/usr/lib64]$ ll | grep libssl.so.1.1
lrwxrwxrwx 1 root root 16 libssl.so.1.1 -> libssl.so.1.1.1g
-rwxr-xr-x 1 root root 603568 libssl.so.1.1.1g

cp libcrypto.so.1.1 /usr/lib64/

再次尝试登录OK :

$ mysql
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
]$ mysql -u***** -p
Enter password:
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
$ mysql -u****** -p -P3306 -h 127.0.0.1
Enter password:
ERROR 1045 (28000): Access denied for user '*'@‘127.0.0.1’ (using password: YES)
$ mysql -u
-p -P3306 -h 127.0.0.1
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.

你可能感兴趣的:(数据库mysql,mysql)