LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-28-2011, 01:06 PM   #1
Latios
Member
 
Registered: Dec 2010
Distribution: Arch
Posts: 115

Rep: Reputation: 21
Cant connect to MYSQL on localhost


Running MYSQL 5.5.12 and MYSQL Workbench 1:5.2.34 on up-to-date Arch linux

Set up MYSQL with root account and password. When running Workbench as user, got error when trying to connect :

Quote:
Cannot Connect to Database Server
Your connection attempt failed for user 'root' from your host to server at 127.0.0.1:3306:
Can't connect to MySQL server on '127.0.0.1' (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
After commenting #skip-networking in my.cnf error changed to :

Quote:
Cannot Connect to Database Server
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: 0

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
Copying my.cnf to /etc/ and running Workbench as root didn't change anything, i still get the second error

The wiki https://wiki.archlinux.org/index.php/MySQL says to enable MYSQL in /etc/hosts.allow but i didn't do it, i guess it is required only when trying to access MYSQL from remote hosts which i dont
 
Old 05-28-2011, 03:02 PM   #2
Latios
Member
 
Registered: Dec 2010
Distribution: Arch
Posts: 115

Original Poster
Rep: Reputation: 21
update : it WAS the hosts.allow file. Problem is solved
 
Old 05-28-2011, 08:15 PM   #3
The Russian
Member
 
Registered: May 2011
Location: localhost
Distribution: Debian, Ubuntu, Fedora, CentOS, and anything other than KDE.
Posts: 38

Rep: Reputation: Disabled
Please mark as solved.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql error connect to server at 'localhost' failed pete44904 Linux - Server 10 11-23-2012 06:08 AM
[SOLVED] Why the php mysql_connect() only can connect localhost MySQL? avinc Linux - Server 5 04-18-2011 07:25 PM
mysqladmin: connect to server at 'localhost' failed(Confusion abot MySQL and mysqladm Terry56 Linux - Server 4 03-10-2010 07:20 AM
mysql db running on SUSE 10. Java code fails to connect from localhost Carlos2dub SUSE / openSUSE 1 07-04-2008 09:23 AM
Can't connect to (non localhost) mysql server from laptop or desktop. DiBosco Linux - Server 9 01-20-2008 12:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration