5

Ok, I've got a fresh Fedora 12 install, and I have installed mysql via yum. I searched around, including a couple similar posts on this site, but haven't been able to find an answer to my issue specifically.

The first thing I tried to do was set the root password, but I recieved an error.

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!

then..

[root@FC ~]# mysqld

Command not found. Similar command is: 'mysql'

So, I do a whereis mysql.sock, thinking I can find the origin of the file and point my configuration file there.

[root@FC ~]# whereis mysql.sock
mysql: /usr/bin/mysql /usr/lib/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz

Cool, just point socket in my.cnf to /usr/bin/mysql and that should work, right?

Wrong, for some reason it didn't even update the path in the error? Still shows 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'. Can anyone point me in the right direction?

3 Answers 3

3

Building on the previous answers, all you should need to do is:

yum install mysql-server
service mysqld start

The first time the service is started, it should prompt you to set the root password.

2

Try typing:

service mysqld status

If it says anything other than that it is running try typing:

service mysqld start
3
  • That results in "unrecognized service"...
    – cinqoTimo
    Jan 26, 2010 at 22:34
  • Did you install the mysql client or just the server? If you have a 64bit machine, post the results of: "yum info mysql-server.x86_64"
    – malonso
    Jan 26, 2010 at 22:45
  • This is actually my first time installing it from scratch, on a physically present linux box. I normally use hosted virtual servers which already have it installed. And I use XAMP for a development enviroment. I belive I only installed the server along with phpmyadmin. I am running a 32-bit system. I tried the command you posted - I received "no matching packages in list"
    – cinqoTimo
    Jan 26, 2010 at 23:02
1

Couple of clarifications:

  • /var/lib/mysql/mysql.sock is a file that is created by mysqld when it runs, it is what the client uses to connect to the server. If it isn't found then that means most likely the server isn't running
  • /usr/bin/mysql is the client executable. This is what connects to the mysql server. You should not point the socket in my.cnf to this file.

I agree with malonso that the server is probably not installed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .