mysql错误|mysql错误 '/var/lib/mysql/mysql.sock'无法连接数据库

[root@localhost ~]# mysql -uroot -p123 ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)

【mysql错误|mysql错误 '/var/lib/mysql/mysql.sock'无法连接数据库】解决方法:
[root@localhost ~]# mysql -h 127.0.0.1 -uroot -p123 Welcome to the MariaDB monitor.Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.7.24 Source distributionCopyright (c) 2000, 2014, Oracle, MariaDB Corporation Ab and others.Type 'help; ' or '\h' for help. Type '\c' to clear the current input statement.MySQL [(none)]> quit; Bye

    推荐阅读