mysql.sock

mysql.sock is not created OSX

核能气质少年 提交于 2019-12-01 05:39:26
I run mysql on OSX, now when I restart my computer it does not create the mysql.sock, meaning that all my connections gives me a error 2002. anyone knows how to prevent this? I had this same issue on Snow Leopard, the socket spawns in the wrong location for some reason on OS X. To get the socket spawning in the correct location: create a new file "my.cnf" in /etc with the following lines: [mysqld] socket=/var/mysql/mysql.sock [client] socket=/var/mysql/mysql.sock and restart mysqld: sudo /usr/local/mysql/bin/mysqld_safe This will force the MySQL socket file to spawn in the proper location, and

Missing mysql.sock; yielding OperationalError: (2002, “Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)”)

安稳与你 提交于 2019-11-29 11:47:33
Firstly, I swear that I have looked at every single question that references this error. Nearly every solution someone offers is different, and no one seems to understand the systemic reasons for the error. What I, and many people on the web who encounter this common problem, need, is an explanation of what is actually going wrong. Basically, when I try to run: python manage.py shell from django.db import connection cursor = connection.cursor() with Django 1.4 and python 2.7.3, I get the following error: OperationalError: (2002, "Can't connect to local MySQL server through socket '/tmp/mysql

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

血红的双手。 提交于 2019-11-28 17:01:24
I am trying to run mysql client on my terminal. I have installed the latest mysql gem. ➜ ~ git:(master) ✗ ruby -v ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0] ➜ ~ git:(master) ✗ rails -v Rails 2.3.14 ➜ ~ git:(master) ✗ which mysql mysql: aliased to nocorrect mysql ➜ ~ git:(master) ✗ which ruby /usr/bin/ruby ➜ ~ git:(master) ✗ which rails /usr/bin/rails ➜ ~ git:(master) ✗ gem list *** LOCAL GEMS *** actionmailer (2.3.14) actionpack (2.3.14) activerecord (2.3.14) activeresource (2.3.14) activesupport (2.3.14) builder (2.1.2) bundler (1.0.21) capistrano (2.9.0) capybara (0.3.9)

OperationalError: (2002, “Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)”)

对着背影说爱祢 提交于 2019-11-27 13:56:15
问题 when connecting to mysql database in Django ,I get the error. I'm sure mysql server is running. /var/run/mysqld/mysqld.sock doesn't exist. When I run $ find / -name *.sock -type s , I only get /tmp/mysql.sock and some other irrelevant output. I added socket = /tmp/mysql.sock to /etc/my.cnf. And then restared mysql, exited django shell, and connected to mysql database. I still got the same error. I searched a lot, but I still don't know how to do. Any help is greate. Thanks in advance. Well, I

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

Deadly 提交于 2019-11-27 10:19:53
问题 I am trying to run mysql client on my terminal. I have installed the latest mysql gem. ➜ ~ git:(master) ✗ ruby -v ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0] ➜ ~ git:(master) ✗ rails -v Rails 2.3.14 ➜ ~ git:(master) ✗ which mysql mysql: aliased to nocorrect mysql ➜ ~ git:(master) ✗ which ruby /usr/bin/ruby ➜ ~ git:(master) ✗ which rails /usr/bin/rails ➜ ~ git:(master) ✗ gem list *** LOCAL GEMS *** actionmailer (2.3.14) actionpack (2.3.14) activerecord (2.3.14) activeresource