Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    MYSQL




Several /tmp/mysql.sock Connections


I did a netstat -an and I saw around 80 lines like this:

c41cd9d8 stream 0 0 0 c41cd230 0 0 /tmp/mysql.sock

Is the server holding too many connections and then cant handle anymore?

What can I do to fix this?

I am running Mysql 3.23.49 with persistant connections off.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Mysql.sock
Yesterday I removed mysql, and then re-installed it. (version 5 on Mac OS X) and found that file 'mysql.sock' in the /tmp/ folder is missing.. Does anybody know were I can find it and copy into that folder.

Mysql.sock
I've recently downloaded PHP and Apache to my Windows XP machine. I am doing some web front end development using mysql as the database. When I attempt to connect to the database from the PHP page I am getting the following message,

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

I have searched through my machine and mysql.sock does not exist anywhere on my machine. I am signed in to mysql as root. I have checked all the ini files and they expect the sock file to be under /tmp .

Mysql.sock
how come my /var/lib/mysql/mysql.sock file contains no data?

is it because of this that i can't start the mysql server?

i'm running fedora core 4
kernel 2.6.11
mysql 4.1

Mysql.sock
I tried to log in to my mysql database and got the message
could not find mysql.sock in /tmp.

In the mysql-configuration file /etc/my.cnf (in my redhat system 8.0)
I changed the place for the socket file from
"socket=/var/lib/mysql/mysql.sock" to "socket=/tmp/mysql.sock".

That doesn´t work.

What can I do?

Mysql.sock
after Installing mysql I started the mysql daemon.. The I tried to log
in to my mysql database and got the message could not find mysql.sock
in /tmp.

In the mysql-configuration file /etc/my.cnf (in my redhat system 8.0)
I
changed the place for the socket file from
"socket=/var/lib/mysql/mysql.sock" to "socket=/tmp/mysql.sock".
That doesn´t work.

What can I do? Perhaps put a link ln -s /var/lib/mysql/mysql.sock
/tmp/mysql.sock in /tmp????

Mysql.sock
after Installing mysql I started the mysql daemon.. The I tried to log
in to my mysql database and got the message could not find mysql.sock
in /tmp.

In the mysql-configuration file /etc/my.cnf (in my redhat system 8.0)
I
changed the place for the socket file from
"socket=/var/lib/mysql/mysql.sock" to "socket=/tmp/mysql.sock".
That doesn´t work.

What can I do? Perhaps put a link ln -s /var/lib/mysql/mysql.sock
/tmp/mysql.sock in /tmp????

MySQL.sock
I just got slack9.0 running about a week ago.
My proble is that I cant connect to mysql
This is the error it gives me.
---------------------------------------------------------------
ERROR 2002: Can't connect to local MySQL server through socket
'/var/run/mysql/mysql.sock' (2)
---------------------------------------------------------------
I'm pretty new still to linux and thouroghly confused.
I dont know where to get this file.
And I cant find my mysql error log file.. sniffle sniffle .

Mysql.sock
I have been unable to use MySql on Mandrake 10.1.

According to the startup messages MySql is started and is then taken down
again at the end of a session. When I try to use MySql, however, I get a
message that says "/var/lib/mysql/mysql.sock" is not accessible. In fact,
it does not exist. I cannot confirm that MySql is actually running.

Mysql.sock
which exe program in the bin of 5.1 on windows is equivelent to the mysql.sock on unix type systems?

/tmp/mysql.sock
Guys I only found out SQL exists yesterday, and I still dont understand what it is. But I have followed instructions on a self install script word document. However, logging into my domain name which is on a sharred hosting Linux server(yes I painfully found this out) it gives me, I say it I mean opening up the .php extention page which I uploaded onto using FTP. I get the following error:
/tmp/mysql.sock
And thats that. I have no idea how to fix this, and after googling in up, all I get is ideas of changing the root file ect ect. Whats a root file?? I dont host the site myself, its on a sharred hosting site. Ok if anyoner here can help me you will be nominated for an oscar award as far as I am concerned.

Mysql.sock
im new here and im a complete newbie about mysql.Im using a sles 9.0 with freeradius. when I try to login using this command mysql -p, then the computer ask for a password.and then I input the password the there was an error."Cant connect to local MYSQL server through socket '/var/lib/mysql/mysql.sock'. but when I try to go to the path, I have no file mysql.sock. It seems that I miss to install file. How do I correct this, I have no Idea how to do this.

Mysql.sock
i installed redhat 9 with all the required packages..next i installed apache and i have it all up...next i installed mysql
all is fine without errors BUT when i start it using /etc/init.d/mysql start...nothing happens...

i installed mysql by
1. tar xvzf mysql-4.0.18.tar.gz
2.make
3. make install
then i went to mysql_install_db

and when i try to type mysql at the shell
i get the error

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

and the funny thing is mysql.sock doesn't exist...it is nowhere in sight...

'/tmp/mysql.sock' !
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2). The software "MySql" is on my Windows XP machine and my website is on a Linux server.  What is the problem ?

Mysql.sock
after Installing mysql I started the mysql daemon.. The I tried to log
in to my mysql database and got the message could not find mysql.sock
in /tmp.

In the mysql-configuration file /etc/my.cnf (in my redhat system 8.0)
I
changed the place for the socket file from
"socket=/var/lib/mysql/mysql.sock" to "socket=/tmp/mysql.sock".
That doesn´t work.
What can I do? Perhaps put a link ln -s /var/lib/mysql/mysql.sock
/tmp/mysql.sock in /tmp?

Mysql.sock Error
Whenever I try to connect to mysql server, I get the following error:

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

But mysql server is running(checked that from nmap). There is no file mysql.sock at the above location.

Missing Mysql.sock
i upgraded from 3.23 to 4.0.23 on a rh 9 installation, had to force the upgrade, and the mysql.sock file is now missing, tried uninstalling/reinstalling, but get 'package not installed' and 'package already installed' messages. Is it possible to get a copy of mysql.sock or is it something created on installation only?

Mysql.sock File
I installed the base MySQL 4.0 with Suse Linux and I try and start it and I get anb issue with the fact that mysql.sock file does not exist in /etc..../mysql/mysql.sock

I created a file and made sure the owner is mysql. Can anyone share a template for what this file should look like?

Missing /tmp/mysql.sock
I installed mysql about a month ago & everything has gone quite well. When I need to start mysql, I've been doing so on the command line via /etc/init.d/mysql start (haven't been interested in getting it to start at boot time yet).

Today I went to start up mysql and it wasn't in /etc/init.d/. I did a 'which mysql' and found it in /usr/bin/. Don't know how it got there. When i tried that path, I got the error ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2). Sure enough, there's no socket in the /tmp/ directory. In fact when i ran 'find' it said there is no file named mysql.sock anywhere on my computer.

Now i haven't messed around with this stuff since i installed mysql so I don't know what I (presumably) did to move them around. But the question is, can i just copy these files back from somewhere? Or is this going to be harder than that?

Mysql.sock Error
Ok I have came across the following error when trying to run a simple insert query to a remote database. The connection and database selection is made fine with no errors but then it errors on the insert query, the error is:

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

Any one know what exactly the above means?

ERROR 2002 (HY000): Can't Connect To Local MySQL Server Through Socket '/var/lib/mysql/mysql.sock' (13)
I have a problem connecting to sql and can't find anything on the net to solve the problem.

I have some sql databases running on a server. when I'm root on the server and I want to login to sql I do "mysql -ustudent -p -Dwordnet30 and it works fine. when I'm logged in with the user account on the server, i get this error message:

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

so with the same user name in mysql, i can log on when i'm root, but not when i'm the user. the grant table for the user looks like this: Code:

Can't Connect To Local MySQL Server Through Socket '/home/data/mysql/mysql.sock' (13)
I just installed mysql on linux. If I open a terminal, su to root,
then type "mysql", I am able to connect to the server and run my
queries.

If I exit out of su so that I am my own id (baisley) and type "mysql",
I get this error: Can't connect to local MySQL server through socket
'/home/data/mysql/mysql.sock' (13)

Any idea why? mysql.sock has full permissions (read/write/execute), so
it should be accessable by user baisley. If I am baisley and I run
"mysql -u mysql" (as mysql is the user that the RPM set up), it will
connect.

What I would like to be able to do is run this without having to be
user mysql all the time. How do I go about setting that up, or is it
better to run all my queries/make tables as 1 user?

Recreating The Mysql.sock File
I have a production system, that is running away with no problems.
However every so often the command line 'mysql' seems to be unable to
connect to the main server running. It complains it can't find the
file.

Now here is the rub; the file is there; it has the correct
permissions. Now before any smart-a**e says to restart MySQL server,
i can't. Its a production site and therefore i don't wish to restart
it.

So the question is, how does one recreate this file on a live system?
And second question is why does it lose the file in the first place?

Recreating The Mysql.sock File
looking through all the forums and newsgroups it would appear that
mysql.sock is definitely one for the Top10 of all time problems.
However, i have yet to see an answer that properly addresses it.

I have a production system, that is running away with no problems.
However every so often the command line 'mysql' seems to be unable to
connect to the main server running. It complains it can't find the
file.

Now here is the rub; the file is there; it has the correct
permissions. Now before any smart-a**e says to restart MySQL server,
i can't. Its a production site and therefore i don't wish to restart
it.

So the question is, how does one recreate this file on a live system?
And second question is why does it lose the file in the first place?

Problem With 'mysql.sock' File
I installed mysql 5.0 on redhat 9.0 from source (tar).
The whole procedure occured properly, i could do ./mysqld_safe.
But when i want to start the client: mysql, i get :error 2002: cannot
connect to mysql server through 'tmp/mysql.sock'.

I set /tmp with the sticky bit, because otherwise file 'mysql.sock' woukd be
deleted !?.
I also created 'my.cnp into /etc, but my problem is that there is no file
'mysql.sock'.

I recompiled it again (make, make install) but still no file 'mysql.sock'
anywhere.

Warning: Mysql_query(): Can't Connect To Local MySQL Server Through Socket '/tmp/mysql.sock' (2)
I'm trying to connect to my MySQL database (sitehosted by GoDaddy) using PHP. I am having these errors and don't understand what they mean

Warning: mysql_query(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/content/n/l/a/nladmin/html/v5.0_3/c_register.php on line 6
Warning: mysql_query(): A link to the server could not be established in /home/content/n/l/a/nladmin/html/v5.0_3/c_register.php on line 6

Notice: Query: SELECT * FROM types MySQL error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/content/n/l/a/nladmin/html/v5.0_3/c_register.php on line 6
here4
Warning: mysql_close(): no MySQL-Link resource supplied in /home/content/n/l/a/nladmin/html/v5.0_3/c_register.php on line 13

I've checked paths and connection settings and don't see any problems. My guess is now that the problem is coming from the opening and closing of the DB. my script, c_register.php uses a require_once('../mysql_connect.php') to open the connection to the database. But I also have a function definition in c_register.php that uses require_once('../mysql_connect.php') when called because it needs a connection to the DB. Here's a visual that might help:

Download Of Mysql.sock File Unable To Connect To Mysql Server
Where can i get the download mysql.sock file?

I am unable to connect to local server because i dont have this file?

ERROR 2002 (HY000): Can't Connect To Local MySQL Server Through Socket '/tmp/mysql.sock' (2)
I want to user ports to install phpBB
But I found that phpBB doesn't support mysql 5.x (but the ports
installed mySQL 5.0.0 alpha)

so I deinstall mysql5-server and mysql5-client
And then I install mysql41-server and mysql41-client on FreeBSD 5.3 by
ports but now , mysql is not workable Code:

Can't Connect To Local MySQL Server Through Socket '/tmp/mysql.sock' (2)
I have this error whe I'm trying to connect MySQL from PHP. But I can connect with Query Browser or some other software.
Why I get this error? How can I fix this?

Can't Connect To Local MySQL Server Through Socket '/tmp/mysql.sock' (46)
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (46)

I get this error when I try to communicate with a table I made using a text file ...

Can't Connect To Local MySQL Server Through Socket '/tmp/mysql.sock' (2)
I am using a Mac running Mac OS X 10.4.8 and I have successfully installed MySQL on it but when I go to run it using the command

sudo ./bin/mysqld_safe &

all it does is display a random dumber and when I try the command

./bin/mysqlshow -u root -p

I get an error message saying

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

Mac OS 10.3 -- Can't Connect To Local MySQL Server Through Socket '/tmp/mysql.sock'
I just downloaded & installed MYSQL. It seemed to work and I can start
it and enter my password and change a directory but that is about all.
I have been ready and playing "hit & miss" all afternoon and it seems
to have something to do with the "mysql_install_db" not being
installed correctly -- I have tried multiple installs with multiple
downloaws.

My log. . .

Can't Connect To Local MySQL Server Through Socket '/tmp/mysql.sock'
I've installed MySQL-4.0.14 under RedHat 8, using both rpm's and compiling
from source. When I try to run MySQL, I get the following error: Can't
connect to local MySQL server through socket '/tmp/mysql.sock'

After much searching on Google, and reading many newsgroup threads on this
error, as well as reading the manual, I'm still stumped. Most of the
advice I've found suggests that the path to mysql.sock is wrong, which
makes sense, but I don't have the file mysql.sock anywhere on my machine,
so obviously I can't correct the path.

Can't Connect To Local MySQL Server Through Socket '/tmp/mysql.sock' (2)
I just got mysql 5, from mysql 3 or 4 (can't remember it's been so long). I can't seem to get a connection. I searched and found http://dev.mysql.com/doc/refman/5.0/en/unix-post-installation.html#starting-server

Here is what it says to do, I don't know enough to be able to follow. Please advise:

If you have problems starting the server, here are some things to try:

* Check the error log to see why the server does not start.
ME: How? Where?
* Specify any special options needed by the storage engines you are using.
* Make sure that the server knows where to find the data directory.
ME: How?
* Make sure that the server can access the data directory. The ownership and permissions of the data directory and its contents must be set such that the server can read and modify them.

Can't Connect To MySQL Through Socket '/tmp/mysql.sock'
I installed mysql on both of my mac machines running 10.3.9 and 10.4.1. Everything was fine when I installed mysql. Then I shut down both mysql and my computers. When I tried to start up mysql again, it said:

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

mysql mysqld
and
mysql mysqld_safe &
and
mysql -u root
and it always said "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)"
I also tried
./bin/mysqld_safe --user=mysql &
and it said "Permision denied"

I know some of you have answered a billioin questions like this before, but I've searched all over the internet and none of the solutions seems to work.

# Of Mysql Connections
I was wondering what you guys thought about this. How many mysql connections do you think is to many on a php page?

Mysql Connections
I am currently running MySQL 5.0 on RHE3.

I would like to know if someone can tell me how can I get the total number of connections/session to the mysql server via the console or command line?

MySQL Connections
A shared hosting provider allows to setup 10 MySQL databases. The only thing is that each database is forced into having its own username and password, which means a separate connection has got to be made to each database.
Is there a way to join tables over the two connections

How Do You Open Mysql To Outside Connections?
I have a DB server and an APP server.

I am trying to open MySQL on the DB server so the APP server can connect to it.

I did the command:

GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'%'
IDENTIFIED BY 'PW' WITH GRANT OPTION;

However, it still won't connect.

Closing MySQL Connections
Here's a question for you, my hosts have told me that that one my pages,
php, was causing their server to reboot because there were too many open
connections and that they should be closed.

Now, correct me if I am wrong but I thought that the connections were closed
after a minute of inactivity.

Does this sound right? Could open connections cause their server to reboot a
lot, say 3 times in 15 minutes? If so, what can I do about it?

How Do You Stop All The Connections To MySQL?
I don't want any application accessing my databases while performing the recovery operations. In Oracle, you can stop the TNS listener on the server side. What is the equivalent of this in MySQL?

Managing MySQL Connections...
MySQL is currently reaching its limit of connections, and is not responding to new ones. What would prevent against this?

Would closing the connection through PHP at the end of every page help with mysqli_close();

Or should I set my max_connections in the my.ini configuration file to a higher number?

What other ways can lower the amount of connections?

Best Practices For Php/mysql Connections
I'm working on a data intensive project right now and though I'm able to write code I'm by no means a php or mysql guru, to say I know 'just enough' would be a good statement. So I'd like to ask those who know better...

Without going into specifics; users will be searching the database, and/or adding data to the database. I would estimate that there will be far more searches than additions/edits.

One of my main concerns is managing the connection to the database for each user. What would the most efficient method be, generally speaking? I would think that I do not want them to establish a connection for each request.

Getting Mysql Error Too Many Connections
I have limited controll of the server settings for MySQL all I can do is create a database, a database user and delete database. I can also use myPhP admin to manage the tables and stuff but as far as controlling the sql server thats all on the hosting company.

I recently set up a forum boards (SMF forums its great) all of a sudden one day I went to optimize the tables and whammo the whole board stopped working.

When I went to log into plesk and go into My Php admin it keeps giving me this error

"Welcome to phpMyAdmin 2.6.0-pl3

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in config.inc.php and make sure that they correspond to the information given by the administrator of the MySQL server.

MySQL said:

#1040 - Too many connections

What exactly is this error and how do I fix it. I am a noobie with My Sql

is this a problem with my hosting companys server or is this an issue I can fix?

My hosting support said my database is corrupt (figured that much) but I can't restore untill I can overcome this error..

Netstat And 500 MySQL Connections
I was performing some benchmarking on my app and discovered that it opens 400-500 MySQL connections show by the netstat command:

tcp 0 0 enssbos:36185 enssbos:mysql TIME_WAIT
tcp 0 0 enssbos:36184 enssbos:mysql TIME_WAIT
tcp 0 0 enssbos:36191 enssbos:mysql TIME_WAIT
tcp 0 0 enssbos:36190 enssbos:mysql TIME_WAIT
tcp 0 0 enssbos:36189 enssbos:mysql TIME_WAIT
tcp 0 0 enssbos:36188 enssbos:mysql TIME_WAIT
tcp 0 0 enssbos:36179 enssbos:mysql TIME_WAIT
tcp 0 0 enssbos:36177 enssbos:mysql TIME_WAIT
tcp 0 0 enssbos:36176 enssbos:mysql TIME_WAIT
.
Does this look right? Why are there so many tcp network connections for one script? I do use ajax with multiple updates, but I feel as if I am going to run into problems here.

Closing Persistent Connections In Mysql
it might be a stupid question,but I just want to know how can we close persistent connection in mysql (using php).

what are the advantages and disadvantages for using persistent connection?


Tracking MySQL Outgoing Connections
I currently have this serious issue where a bunch of mysql connections are being sent from one of my servers to another. I think its a virus or some sort of hole in my scripting but my main server keeps on sending fake logins to my database server.

I do not know how this is happening, but IS THERE A WAY for the mysql client (not the database server) to track all of the outgoing connections that are being made?

MySQL Max Connections Remote And Local
My website runs on two servers. One is mean't for PHP and the other is the database MySQL. Whenever a request is made, the PHP attempts to connect to the MySQL via a remove host variable in the mysql_pconnect() function. This works fine, however when it comes down to having lots of connections in the my.cnf file, which one do I edit?

max_connections = 1000

Now do I set this in the MySQL only, or do I set it in the PHP server as well?

Remote MySQL Connections, Still Not Working
I've read, and done all the tutorials, forum posts, and comments I could find regarding setting up a mysql server access for remote connections, but I still seem to have problems. I have a LAMP server running behind a closed router connection. A dynamic DNS is masking the connection, and I have the appropriate ports open for HTTP, SSH, VNC, FTP, and I thought MySQL (3306). But for some reason I still cannot get MySQL to connect from a foreign host.

The I have port forwarding (3306) to the correct system behind the router, and I can access the server just fine via http/ftp. The MySQL server is happily running PHP MyAdmin with the localhost connection too. I've set a (actually a couple now) user to have the ip access of "%", and granted all permissions to that user, flushed the permissions, even restarted the server. I still can't get the remote connection to work.

Mysql Too Many Connections Performance Issues
I have a website running on a linux/apache/mysql/php
server. I receive about 8,000-10,000 visitors a day with about 200,000
to 300,000 page views. The server is a RedHat Linux server running PHP
5.x, MySQL 5.x, Apache 2.x

We have been suffering from a number of performance issues. Our
hosting company has set our max connections to 100, and we are using
persistent connections in PHP. At times the mysqld process takes 100%
of the CPU. We have also been suffering from
mysql_pconnect(): Too many connections errors. What can I do to fix
these issues?

When I run a top on the server I see this ...
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
5567 mysql 16 0 169m 42m 4236 S 81.2 4.2 3078:09 mysqld
32539 apache 15 0 42676 25m 7708 S 1.0 2.5 0:03.40 httpd
32572 apache 15 0 42680 25m 7708 S 1.0 2.5 0:02.98 httpd
32608 apache 15 0 42680 25m 7704 S 1.0 2.5 0:00.72 httpd
32542 apache 15 0 42704 25m 7712 S 0.7 2.5 0:03.38 httpd
32561 apache 15 0 42732 25m 7712 S 0.7 2.5 0:02.61 httpd
32567 apache 15 0 42680 25m 7708 S 0.7 2.5 0:02.60 httpd
32591 apache ...................................................


Copyright © 2005-08 www.BigResource.com, All rights reserved