Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

这个实在linux下安装mysql的情况,出现了Can‘t connect
to local MySQL server through socket ‘/tmp/mysql.sock‘ (2)

这个错误,然后service mysql start 一直启动不了。

那么可以用一下的方法

#ps -A|grep mysql

显示类似:

3016 ?        00:00:00 mysqld_safe

3090 ?        00:00:31 mysqld

2.#kill -9 3016

3.#kill -9 3090

4.#/etc/init.d/mysql restart

5.#mysql -u root -p

欧克了。

Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

时间: 2024-08-06 03:42:48

Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)的相关文章

MAC中Django中runserver提示Can't connect to local MySQL server through socket '/tmp/mysql.sock错误

好像不止遇到一次,直接Google就可以了,在stackoverflow中就有答案,答案就是你没有开MySQL - -. stackoverflow链接见 http://stackoverflow.com/questions/16325607/cant-connect-to-local-mysql-server-through-socket-tmp-mysql-sock 开启MySQL的命令如下: mysql.server start MAC中Django中runserver提示Can't co

Can't connect to local MySQL server through socket '/tmp/mysql.sock'

启动mysql之后,不能进入mysql命令行: Can't connect to local MySQL server through socket '/tmp/mysql.sock': 修改/etc/my.cnf 当中 socket=/tmp/mysql.sock 重启mysql,即可 Can't connect to local MySQL server through socket '/tmp/mysql.sock'

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

我在源码编译安装mysql后,虽然mysql服务可以正常启动,但是当我直接执行mysql后,出现了错误. 错误提示如下: [[email protected] ~]# mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 出现错误原因: 由于mysql 默认的mysql.sock 是在/var/lib/mysql/mysql.sock,但linux系统总

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'

原因:找不到mysql.sock文件 解决方法: 1 找到mysql.sock文件位置 echo "show variables" | mysql | grep "socket"或者echo "status" | mysql | grep "socket" 2 ln -s /var/lib/mysql /mysql .sock /tmp/mysql .sock 将两个文件做一个软连接 ERROR 2002 (HY000): C

长久不用的mysql报错ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

mac上安装过mysql: 然而,尝试连接时报错: $ mysql -u root -p Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 尝试去查看mysql.socket文件,发现没有.. $ which mysql /usr/local/bin/mysql 然后试试重启mysql: $ mysql.server start

error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'

1.今天安装了一个mysql 5.7 的二进制安装方式,在连接mysql数据库的时候报了如下错误: [[email protected] mysql]# mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 2.根据提示应该是sock文件不在,通过查看进程配置,发现如下 [[email protected] bin]# ps -ef | grep mys

mac 安装mysql 报错“ERROR 2002 (HY000): Can not connect to local MySQL server through socket '/tmp/mysql.sock' (2)” 解决办法

首先安装 homebrew 再 brew install mysql 之后连接 mysql 无论是登录还是修改初始密码都会报如下的错误 ERROR 2002 (HY000): Can not connect to local MySQL server through socket '/tmp/mysql.sock' (2) 运行如下解决:参考 http://www.thinksaas.cn/group/topic/347978/ unset TMPDIR mysql_install_db --v

mac使用brew安装mysql报RROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

使用mac安装mysql安装完后运行 mysql -uroot -p 报了 ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 这是由于我们没有启动mysql,启动mysql使用 brew services start mysql或者 mysql.server start 在启动前我们可以设置一下root密码 mysql_secure_installation 然

Mac下Mysql启动异常["ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)"]

在mac下使用brew安装mysql,之前没有使用过,今天启动的时候发现启动不了 huijundeMacBook-Pro:bin huijunzhang$ mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 查看mysql的安装位置: huijundeMacBook-Pro:bin huijunzhang$ which mysql /usr/local