Can't connect to local MySQL server through socket
Hi guys
working on a remote PC, Tiny sofa OS, my brothers machine I'm walked me through the setup and adding the root password for mysql and creating a database etc and all went well. How ever contecting to the system again to add another database we get the following error. root@localhost /etc# mysql -u root -p Enter password: ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (111) can any one tell us whats going on please TT |
hmm....... if you have updated your locate database first thing I'd do is
locate mysql.sock and make sure it's actually in that location, if not I think the mysqld.conf in /etc/ will allow you to change it.. but you used it before and it worked fine right? Also, I think you may have to chown or something like that.. I did this a couple days ago.. EDIT: it was rc.mysqld on my system, but anyway, this may be the problem here.... # Note that step one is becoming the mysql user. It's important to do this # before making any changes to the database, or mysqld won't be able to write # to it later (this can be fixed with 'chown -R mysql.mysql /var/lib/mysql'). |
Opps, i didn't do update db at start.
but the mysql.sock is where it says it is. and i cant find mysql.conf TT |
Like I said above, I was wrong.. on my system it's rc.mysqld in /etc/rc.d/rc.mysqld but this is slackware so things are a little different.
Anyhow, just do the "this line will fix it" that includes chown, as I think I did that and it made it work for me.. |
All i can find is this
under /etc/init.d/mysql PATH=/sbin:/usr/sbin:/bin:/usr/bin export PATH # Set some defaults, don't change them here, use /etc/my.cnf datadir=/var/lib/mysql sockdir=/var/run/mysql basedir= pid_file= and in the my.cnf we have # Example mysql config file for medium systems. # # This is for a system with little memory (32M - 64M) where MySQL plays # a important part and systems up to 128M very MySQL is used together with # other programs (like a web server) # # You can copy this file to # /etc/mf.cnf to set global options, # mysql-data-dir/my.cnf to set server-specific options (in this # installation this directory is /home/mysql/var) or # ~/.my.cnf to set user-specific options. # # One can in this file use all long options that the program supports. # If you want to know which options a program support, run the program # with --help option. # The following options will be passed to all MySQL clients [client] #password = your_password port = 3306 socket = /var/run/mysql/mysql.sock # Here follows entries for some specific programs # The MySQL server [mysqld] port = 3306 socket = /var/run/mysql/mysql.sock skip-networking [mysqldump] [mysql] [isamchk] [myisamchk] [mysqlhotcopy] TT :study: |
we have check every thing we know of and still get these errors
root@localhost ~# /etc/init.d/mysql restart No MySQL daemon pid file found. Looked for /var/lib/mysql/localhost.localdomain. pid. [FAILED] Starting MySQL daemon: [ OK ] root@localhost ~# mysql -u root -p Enter password: ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysql/m ysql.sock' (111) TT |
Hello,
Have you ran the "mysql_install_db" script, it should be in your /usr/bin. Also be sure to "chmod 755 /var/run/mysql/mysql.sock" then restart the with "/usr/bin/mysqld restart". This should do the trick, I have been using slackware and that is what I have to do when reinstalling. Hope this helps! Sincerely, Danielallan |
All times are GMT -5. The time now is 08:13 PM. |