-
Website
http://www.tech-recipes.com/ -
Original page
http://www.tech-recipes.com/rx/762/solve-cant-connect-to-local-mysql-server-through-socket-tmpmysqlsock/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
davak
83 comments · 1 points
-
Web Design
3 comments · 1 points
-
danishbacker
9 comments · 1 points
-
flexinfo
11 comments · 1 points
-
Tonychelle
4 comments · 1 points
-
-
Popular Threads
-
Facebook: How To Get Only Status Updates on Your FB Home Page
1 week ago · 4 comments
-
Firefox: Enable Case Sensitive Searches When Using Find (Ctrl+F)
5 days ago · 1 comment
-
Windows 7: How To Disable Live Preview for Taskbar Thumbnails
1 week ago · 2 comments
-
Gmail: How to block a sender from your inbox
3 weeks ago · 3 comments
-
Our first iPhone game GreenThumb available in the App Store
3 weeks ago · 2 comments
-
Facebook: How To Get Only Status Updates on Your FB Home Page
Simply create a symbolic link under the "/tmp" directory BACK to the "mysql.sock" file. Make sure that it's worldwide read/write-able. To do so would be like this:
cd /tmp
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
Try it then -- if it is still having trouble, then you might have something else wrong; otherwise, this is because of the RPM installation that you might've used from Red Hat (aka "Fedora").
Just a friendly hint....cheers!
hg
I had the same problem but it is because my.cnf was not in the default locations
CLIENT:
Default options are read from the following files in the given order:
/etc/my.cnf ~/.my.cnf /usr/local/mysql/etc/my.cnf
So even when I added the [client] section I got the same error, so I did a link
#ln -s /my/cnf/file_location/my.cnf /etc/my.cnf
And it worked great.
:: QUOTE ::
YaST stops a little short of fully installing MySQL. ...
I checked the /var/lib/mysql/ directory only to find it empty! This directory is supposed to include the MySQL foundation files that are necessary to make it all work.
I found the following in the MySQL documentation:
1. Log in as the root user. ("Start" => "Switch User")
2. Open a terminal window (the icon that looks like a monitor behind a clamshell).
3. Type "cd /bin" enter (no quotes). :: usually not nessecary ::
4. Type "mysql_install_db --user=mysql
This is from: http://www.novell.com/coolsolutions/feature/595...
Simply create a symbolic link under the "/tmp" directory BACK to the "mysql.sock" file. Make sure that it's worldwide read/write-able. To do so would be like this:
cd /tmp
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
Try it then -- if it is still having trouble, then you might have something else wrong; otherwise, this is because of the RPM installation that you might've used from Red Hat (aka "Fedora").
Just a friendly hint....cheers!
hg</ul>
Actually, this helped tremendously. I am on OS X 10.5 and I don't seem to have a my.cnf file. However, when I tried to connect to mysql, I got the norm error can't connect to . . . through socket . . . "/var/mysql/mysql.sock". A quick search confirmed that /var/mysql/mysql.sock did not exist. I would not have known how to fix this (as a copy paste would not have worked for a socket file) so your post was the solution I implemented, creating a link in /var/mysql that targeted the /tmp/mysql.sock
Thanks!
crab
1. Log in as the root user. ("Start" => "Switch User")
2. Open a terminal window (the icon that looks like a monitor behind a clamshell).
3. Type "cd /bin" enter (no quotes). :: usually not nessecary ::
4. Type "mysql_install_db --user=mysql
This is from: http://www.novell.com/coolsolutions/feature/595...
mysql_fetch_assoc();
/*as you can see the resource parameter of mysql_fetch_assoc(<$resource>)*/ is missing
do help please...!!!
The reason fo client is bad serwer name in "mysql_connect" function. For example database is:
"http://abc.def.ghi.com/mysql5/"
so you should use it properly like this:
mysql_connect("abc.def.ghi.com",...);
insted of not properly like this:
mysql_connect("http://abc.def.ghi.com/mysql5/",...);
mysql_connect("localhost",...);
not work
It came in real handy when the geniouses at opensuse broke an update of mysql to mysql-5.1.34-29.1 by putting the mysql.sock and mysqld.pid in /var/run/mysql instead of /var/lib/mysql as normal. Great quick fix was found here. In addition to /etc/my.cnf, the init script at /usr/sbin/rcmysql needed to be fixed as well.
Thanks
I try with de line:
mysql --socket=/var/lib/mysql/mysql.sock ...
but now the terminal list this error:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
would you can help me
Thanku very much