mysql error connect to server at 'localhost' failed
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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:
mysqladmin -u mysql -p create xoops4
to create a new user it asks me for a password for mysql but i haven't given it one yet and when i enter a password i get the following error. I have tried to search google for a solution to it but i couldn't find one.
Code:
[root@xoops ~]# mysqladmin -u mysql -p create xoops4
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'mysql'@'localhost' (using password: YES)'
Any help on what i am doing wrong would be greatly appreciated -
[~]# 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!
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.
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.
Last edited by Wim Sturkenboom; 07-01-2009 at 07:43 AM.
Reason: I think I was on the wrong track with my original post
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.