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 connect to local MySQL server through socket '/tmp/mysql.sock错误

时间: 2024-10-14 08:27:37

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

Mac mySql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)的解决办法

我的环境:Mac 10.11.6 ,mysql  5.7.14  . mac mySql 报错ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 这个错是链接时报的错,要链接必须启动.修复的时候首先要启动mysql. 首先来了解一下 mysql.sock的作用: Mysql有两种连接方式: (1),TCP/IP (2),socket 对mysql.sock来说,其

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下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

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

好久不用mysql,今天突然想用的时候, mysql -uroot -p 直接报了下面的错误 ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) mac可以在设置里面启动mysql,设置里面启动mysql的时候提示没有/usr/local/mysql/data的权限, 给予权限 sudo chown -R mysql:mysql  /usr/local/mysql

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 OS X下MySQL出现Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)的问题

网上类似的很多,大都是说修改my.cnf之类的,在我这种情况下不凑效,另外,好多都是Linux下的,试了好久,最后的原因竟然相当简单:MySQL服务没起来. 因为对mysql.sock文件不是很熟,刚开始很大的时间都浪费在了这上面,重装后都不行,后来进入/usr/local/mysql/bin/下使用mysqld启动,出现下面的问题 好吧,我用root启动,结果又出现 Please read "Security" section of the manual to find out ho

Mac端解决:Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

安装mysql但是从来没启动过,今天一启动就报错: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 其实是mysql服务没起来... localhost:~ miaoying$ mysql.server start Starting MySQL ... SUCCESS! 然后再去sudo mysql就行了 Mac端解决:Can't connect to local MySQL server thro

Mac brew 安装mysql 报错 ERROR 2002 (HY000): Can't connect to local MySQL server through socket

安装mysql 最新版 56 brew install mysql 启动报错 ben:~ soul$ which mysql /usr/local/bin/mysql ben:~ soul$ mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 解决办法 运行 ben:~ soul$ mysql.server start Starting MySQL .

连接Mysql提示Can’t connect to local MySQL server through socket的解决方法

mysql,Mysqldump,Mysqladmin,php连接mysql服务常会提示下面错误: 1 ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) 这是由于修改mysql服务的了socket文件mysql.sock位置,而导致无法通过mysql socket文件连接到mysql服务引起的,具体解决办法如下:1.查看mysql服务的sock