安装mysql rpm包后输入mysql出现 Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
解决方法。
奋斗一晚终于找到解决方法(适用于我的,原理还不太明白有待进一步学习)总结如下:
首先:
/usr/bin/mysql_install_db
然后:
find / -name mysql.server
找到mysql.server这个文件所在复制到/etc/rc.d/init.d中改名为mysqld
然后要启动mysql时输入/etc/rc.d/init.d/mysqld start回车
最后:
[root@localhost ~]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 5.0.22-standard
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 5.0.22-standard
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
熟悉的结果出现了!
第一次在liunx里装软件,破费周折啊!从网上找了很多关于这种错误的文章,但都不适用于我的情况,可能本文也不适用于你的,那就继续努力吧,好事多磨!!