LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   howto create socket for MySQL (https://www.linuxquestions.org/questions/linux-software-2/howto-create-socket-for-mysql-4175496956/)

rdx 03-04-2014 12:57 AM

howto create socket for MySQL
 
I just installed slackware 14 and I'm trying to get MySQL set up but the unix socket used by the server doesn't exist. I vaguely remember there is a script somewhere but I can't find it or any ref to it in the manual. This is 5.5.32-MariaDB. How do I get the create the socket?

MensaWater 03-04-2014 01:23 PM

Socket is usually just reference to IP and port.

Are you getting a message saying unable to create socket? If so what port is it complaining about? (5432 is the default for MySql).

If you run "lsof -i :<port>" for whatever socket it is talking about see if it is already running a process. If it is that is why it can't create the new socket. You'd have to stop that process that was already running it.

astrogeek 03-04-2014 01:26 PM

Quote:

Originally Posted by rdx (Post 5128524)
I just installed slackware 14 and I'm trying to get MySQL set up but the unix socket used by the server doesn't exist. I vaguely remember there is a script somewhere but I can't find it or any ref to it in the manual. This is 5.5.32-MariaDB. How do I get the create the socket?

What is the message you are getting, and where?

Usually the "Unable to connect to socket" message you see is because the MariaDB/mysql server is not actually running.

Read /etc/rc.d/rc.mysqld for instructions on getting it started the first time.

rdx 03-04-2014 01:49 PM

ok, the server is not running. It starts and dies immediately. The log shows several errors, can't find files:
./mysql/plugin.frm (errno 13)
can't open the mysql/plugin table Please run mysql_upgrade to create it (mysql_upgrade fails)
Fatal error: Can't open and lock privilege tables:Can't find file ./mysql/host.frm

./mysql is drwx------ mysql root

Ok, here is something: the files in ./mysql are root:root. Changing them to mysql:mysql allows the server to run.
Maybe this is the answer, I'm checking it out.

YES, THIS IS WORKING. Thank you all for the hints.

astrogeek 03-04-2014 02:00 PM

Quote:

Originally Posted by rdx (Post 5128861)
ok, the server is not running. It starts and dies immediately. The log shows several errors, can't find files:
./mysql/plugin.frm (errno 13)
can't open the mysql/plugin table Please run mysql_upgrade to create it (mysql_upgrade fails)
Fatal error: Can't open and lock privilege tables:Can't find file ./mysql/host.frm

./mysql is drwx------ mysql root

Ok, here is something: the files in ./mysql are root:root. Changing them to mysql:mysql allows the server to run.
Maybe this is the answer, I'm checking it out.

Yes, set the permissions and paths as instructed in /etc/rc.d/rc.mysqld and it will work.

Not sure if you gave the path as ./mysql for brevity or if you set that as the path, but that will not work if you set it as the path because when the server starts next time at boot that path will not exist, or not be the same.

rdx 03-04-2014 02:10 PM

"Not sure if you gave the path as ./mysql for brevity or if you set that as the path, ... "

Yes, brevity. The full path is /var/lib/mysql/mysql

astrogeek 03-04-2014 02:42 PM

Quote:

Originally Posted by rdx (Post 5128876)
"Not sure if you gave the path as ./mysql for brevity or if you set that as the path, ... "

Yes, brevity. The full path is /var/lib/mysql/mysql

Ok, thanks for responding. Just wanted to make sure you did not set any traps for yourself!

Sounds like you have it going - great!


All times are GMT -5. The time now is 03:52 PM.