mysql error connect to server at 'localhost' failed
Hi i am currently trying to get mysql installed so that i can try out XOOPS on my Fedora 6 test box - but when i try to use the command
Quote:
Code:
[root@xoops ~]# mysqladmin -u mysql -p create xoops4 |
have you set the password for the mysql-root account ? if not first do that -
$> mysqladmin -u root password 'new-password' check if you can connect with the root account - $> mysql -u root -p It will prompt for password. Enter the one you just created. .. then add users and then create databases etc. |
same problem...
[~]# mysqladmin -u root -p status
Enter password: mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)' Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists! any solution or any help ? |
Was a solution to this ever found?
I installed MySql, and I get the failure to connect to localhost running mysql or mysqladmin no matter what user I try. It is not possible to set a password for a user because of the failure to connect. Thanks, Sanford Stein |
Have you seen this thread? Few good suggestions to try.
http://forums.mysql.com/read.php?35,64808,64808 |
Actually I found the solution at:
http://www.redhat.com/magazine/007may05/features/mysql/ The command that worked was: # mysql -u root -p -h localhost and then I entered my root password at the prompt and got mysql> Why this worked, and nothing else did, I can't say |
@Sanford Stein
The mysql client makes certain assumptions when you don't pass information on the command line. In this case it might have passed the wrong host to the server. PS You did not post the exact error that you got, but I think it was a different one from the one in the opening post. |
This issue arrises because there is no sqladmin install. Please install the sqladmin by issuing the below command
yum install mysql-server |
The correct syntax for passing password with "mysql" command is as follows.
[suku@techtrunch]mysql -u root -pyourpassword -h localhost ###see no space after "-p". If you have forgotten the password, since you have root account, reset it. There are lot of sites describing about resetting mysql user passwords. Simply follow those. ---- Suku techtrunch.com |
Just wanted to make one more point here, sometimes you will get the below error when you restart your linux server
Code:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) Code:
service mysqld restart |
Following steps solved this error for me.
openSUSE 11.4 Server version: 5.1.53 Code:
sudo /usr/bin/mysql_install_db |
All times are GMT -5. The time now is 09:34 AM. |