LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   MySQL Start Problem::::socket '/var/run/mysqld/mysqld.sock' (2) (http://www.linuxquestions.org/questions/linux-software-2/mysql-start-problem-socket-var-run-mysqld-mysqld-sock-2-a-822785/)

arun-linux 07-29-2010 03:30 AM

MySQL Start Problem::::socket '/var/run/mysqld/mysqld.sock' (2)
 
Hello Folks,

I am Using Ubuntu lucid10.04,I have installed MySQL-client-core-5.1

It worked fine for 1 day after installation but when i started linux next day and login to connect,it could not get connected citing this message:

Code:

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

______________________________________________________________________
MySQL-workbench login message:
Your connection attempt failed for user 'root' from your host to server at 127.0.0.1:3306:
Lost connection to MySQL server at 'reading initial communication packet', system error: 111

Please:
1 Check that mysql is running on server 127.0.0.1
2 Check that mysql is running on port 3306 (note: 3306 is the default, but this can be changed)
3 Check the root has rights to connect to 127.0.0.1 from your address (mysql rights define what clients can connect to the server and from which machines)
4 Make sure you are both providing a password if needed and using the correct password for 127.0.0.1 connecting from the host address you're connecting from
_____________________________________________________________________


Looking forward for your replies.

--
Regards
Arun

konzo 07-29-2010 04:01 AM

I have had exactly the same problem and I couldn't solve it after two days of trying. I reinstalled since I have fresh install. After install firest I check to backup this socket file but it is some s file and when I tar on it archove seems to be empty.
Code:

/var/run/mysqld/
total 5
drwxr-xr-x  2 mysql root  112 2010-07-29 09:42 ./
drwxr-xr-x 17 root  root  1168 2010-07-29 10:08 ../
-rw-rw----  1 mysql mysql    5 2010-07-29 09:42 mysqld.pid
srwxrwxrwx  1 mysql mysql    0 2010-07-29 09:42 mysqld.sock

I found on internet that I have to reinstall mysql-common, but that didn't help for my problem.

Also try to run mysql with -p and -u parameters (password and user, see --help), but I doubt that will help. In mysql site is a lot of posts on that problem but with no solution(as far for me).

bathory 07-29-2010 04:17 AM

You should check if mysqld is running:
Code:

ps -ef|grep mysqld
If it's running, check my.cnf to see where the socket should be for both nysqld (the daemon) and mysql (the client)

arun-linux 07-29-2010 07:06 AM

Output: ps -ef|grep mysqld
 
@Konzo : Thanks for sharing your problem.But i am still juggling with my problem,require more deep insight for problem.

I already tried re-installation of MySQL but that doesn't help me & problem is still not resolved.
_____________________________________________________________________

Code:

iit@iit-desktop:~$ ps -ef|grep mysqld
iit      6385  4064  0 16:10 pts/1    00:00:00 grep --color=auto mysqld

______________________________________________________________________


After reinstalling MySQL-client-core-5.1,ouput of ps -ef|grep mysqld
______________________________________________________________
Quote:

ps -ef|grep mysqld
iit 6465 1554 0 16:21 ? 00:00:02 /usr/bin/gtk-gnash -x 78946081 -j 300 -k 250 -u http://pagead2.googlesyndication.com...EyCNk3wk0DcY9F -F 82 -U http://googleads.g.doubleclick.net/p...xquestions.org -P allowscriptaccess=never -P flashvars=clickTAG=http://googleads.g.doubleclick.net/aclk%3Fsa%3Dl%26ai%3DBq1GcIV1RTJnbH8WVcI3CtZ4Bq8ikvQGLws7wFavbrcVD0Iz1AxABGAEgj5z0ATgAUKuj6qH9_____w Fg5cLkg6QOsgEWd3d3LmxpbnV4cXVlc3Rpb25zLm9yZ7oBCjMwMHgyNTBfYXPIAQTaAXpodHRwOi8vd3d3LmxpbnV4cXVlc3Rpb2 5zLm9yZy9xdWVzdGlvbnMvbGludXgtc29mdHdhcmUtMi9teXNxbC1zdGFydC1wcm9ibGVtLXNvY2tldC12YXItcnVuLW15c3FsZC 1teXNxbGQtc29jay0yLWEtODIyNzg1L6kC5AM-Fkz_Vj64AhjAAgHIArvqsROoAwHoA90F6AMF9QMCAABE%26num%3D1%26sig%3DAGiWqtxbVt6G0XgEq6V5F8fjfzEImcg2PQ%26 client%3Dca-pub-4420048478783872%26adurl%3Dhttp://track.quasar.co.in/trackQ/trkBanner1.asp%253FBanner%253DBeat_Google_Tech%2526Creative%253DTILYOI2%2526Camp%253DGM_BeatTILYOI2_ Jul10%2526Publisher%253DGoogle%2526Advertiser%253DGM_BeatTILYOI2_Jul10%2526Link%253Dhttp://chevybeat.co.in/test-drive.aspx -P height=250 -P id=google_flash_embed -P pluginspage=http://www.macromedia.com/go/getflashplayer -P src=http://pagead2.googlesyndication.com/pagead/imgad?id=CJCYhouV1_qWgQEQrAIY-gEyCNk3wk0DcY9F -P type=application/x-shockwave-flash -P width=300 -P wmode=opaque -
iit 6778 4064 0 16:31 pts/1 00:00:00 grep --color=auto mysqld
iit@iit-desktop:~$
_________________________________________________________________

Still looking for feasible solutions,please post more replies.

Looking forward for your replies.

--
Regards
Arun

bathory 07-29-2010 08:57 AM

So mysqld is not running, so it can create the socket.
Install mysql-server and start mysqld by running:
Code:

sudo /etc/init.d/mysql start
and see if the socket is created

arun-linux 08-02-2010 01:12 AM

mysqld.sock created: Problem resolved
 
@bathory: Thanks for your Intellectuality,your suggestion worked.

_________________________________________________________________
Code:

iit@iit-desktop:~$ sudo apt-get install mysql-server
[sudo] password for iit:
Reading package lists... Done
Building dependency tree     
Reading state information... Done
The following extra packages will be installed:
  libmysqlclient16 mysql-client-5.1 mysql-client-core-5.1 mysql-common
  mysql-server-5.1 mysql-server-core-5.1
Suggested packages:
  tinyca mailx
The following packages will be REMOVED:
  mysql-client
The following NEW packages will be installed:
  mysql-server mysql-server-5.1
The following packages will be upgraded:
  libmysqlclient16 mysql-client-5.1 mysql-client-core-5.1 mysql-common
  mysql-server-core-5.1
5 upgraded, 2 newly installed, 1 to remove and 4 not upgraded.
Need to get 22.2MB of archives.
After this operation, 15.0MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://mirror.cse.iitd.ernet.in/ubuntu/ lucid-proposed/main mysql-common 5.1.41-3ubuntu12.6 [97.7kB]
Get:2 http://mirror.cse.iitd.ernet.in/ubuntu/ lucid-proposed/main libmysqlclient16 5.1.41-3ubuntu12.6 [1,932kB]
Get:3 http://mirror.cse.iitd.ernet.in/ubuntu/ lucid-proposed/main mysql-client-core-5.1 5.1.41-3ubuntu12.6 [177kB]
Get:4 http://mirror.cse.iitd.ernet.in/ubuntu/ lucid-proposed/main mysql-client-5.1 5.1.41-3ubuntu12.6 [8,138kB]
Get:5 http://mirror.cse.iitd.ernet.in/ubuntu/ lucid-proposed/main mysql-server-core-5.1 5.1.41-3ubuntu12.6 [4,712kB]
Get:6 http://mirror.cse.iitd.ernet.in/ubuntu/ lucid-proposed/main mysql-server-5.1 5.1.41-3ubuntu12.6 [7,008kB]
Get:7 http://mirror.cse.iitd.ernet.in/ubuntu/ lucid-proposed/main mysql-server 5.1.41-3ubuntu12.6 [93.6kB]
Fetched 22.2MB in 2s (11.0MB/s)           
Preconfiguring packages ...
(Reading database ... 420834 files and directories currently installed.)
Removing mysql-client ...
(Reading database ... 420831 files and directories currently installed.)
Preparing to replace mysql-common 5.1.41-3ubuntu12.5 (using .../mysql-common_5.1.41-3ubuntu12.6_all.deb) ...
Unpacking replacement mysql-common ...
Preparing to replace libmysqlclient16 5.1.41-3ubuntu12.5 (using .../libmysqlclient16_5.1.41-3ubuntu12.6_i386.deb) ...
Unpacking replacement libmysqlclient16 ...
Preparing to replace mysql-client-core-5.1 5.1.41-3ubuntu12.5 (using .../mysql-client-core-5.1_5.1.41-3ubuntu12.6_i386.deb) ...
Unpacking replacement mysql-client-core-5.1 ...
Preparing to replace mysql-client-5.1 5.1.41-3ubuntu12.5 (using .../mysql-client-5.1_5.1.41-3ubuntu12.6_i386.deb) ...
Unpacking replacement mysql-client-5.1 ...
Preparing to replace mysql-server-core-5.1 5.1.41-3ubuntu12.5 (using .../mysql-server-core-5.1_5.1.41-3ubuntu12.6_i386.deb) ...
Unpacking replacement mysql-server-core-5.1 ...
Processing triggers for man-db ...
Setting up mysql-common (5.1.41-3ubuntu12.6) ...
Selecting previously deselected package mysql-server-5.1.
(Reading database ... 420831 files and directories currently installed.)
Unpacking mysql-server-5.1 (from .../mysql-server-5.1_5.1.41-3ubuntu12.6_i386.deb) ...
Selecting previously deselected package mysql-server.
Unpacking mysql-server (from .../mysql-server_5.1.41-3ubuntu12.6_all.deb) ...
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot
Processing triggers for man-db ...
Setting up libmysqlclient16 (5.1.41-3ubuntu12.6) ...

Setting up mysql-client-core-5.1 (5.1.41-3ubuntu12.6) ...
Setting up mysql-client-5.1 (5.1.41-3ubuntu12.6) ...
Setting up mysql-server-core-5.1 (5.1.41-3ubuntu12.6) ...
Setting up mysql-server-5.1 (5.1.41-3ubuntu12.6) ...
Installing new version of config file /etc/init/mysql.conf ...
mysql start/running, process 3075

Setting up mysql-server (5.1.41-3ubuntu12.6) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
iit@iit-desktop:~$ sudo /etc/init.d/mysql start
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql start

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start mysql
iit@iit-desktop:~$ sudo /etc/init.d/mysql restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql restart

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the restart(8) utility, e.g. restart mysql
mysql start/running, process 3226
iit@iit-desktop:~$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 44
Server version: 5.1.41-3ubuntu12.6 (Ubuntu)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

__________________________________________________________

jeffstric 11-29-2012 07:56 AM

thanks
 
THX it really help me
Quote:

Originally Posted by bathory (Post 4048998)
So mysqld is not running, so it can create the socket.
Install mysql-server and start mysqld by running:
Code:

sudo /etc/init.d/mysql start
and see if the socket is created



All times are GMT -5. The time now is 12:11 AM.