LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-04-2014, 01:57 AM   #1
rdx
Member
 
Registered: Apr 2007
Location: Dallas
Distribution: Slackware64 14.2
Posts: 274

Rep: Reputation: 25
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?
 
Old 03-04-2014, 02:23 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668
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.
 
Old 03-04-2014, 02:26 PM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_12{.0|.1}
Posts: 5,493
Blog Entries: 11

Rep: Reputation: 3465Reputation: 3465Reputation: 3465Reputation: 3465Reputation: 3465Reputation: 3465Reputation: 3465Reputation: 3465Reputation: 3465Reputation: 3465Reputation: 3465
Quote:
Originally Posted by rdx View Post
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.

Last edited by astrogeek; 03-04-2014 at 02:34 PM.
 
1 members found this post helpful.
Old 03-04-2014, 02:49 PM   #4
rdx
Member
 
Registered: Apr 2007
Location: Dallas
Distribution: Slackware64 14.2
Posts: 274

Original Poster
Rep: Reputation: 25
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.

Last edited by rdx; 03-04-2014 at 02:59 PM. Reason: solved
 
1 members found this post helpful.
Old 03-04-2014, 03:00 PM   #5
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_12{.0|.1}
Posts: 5,493
Blog Entries: 11

Rep: Reputation: 3465Reputation: 3465Reputation: 3465Reputation: 3465Reputation: 3465Reputation: 3465Reputation: 3465Reputation: 3465Reputation: 3465Reputation: 3465Reputation: 3465
Quote:
Originally Posted by rdx View Post
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.
 
Old 03-04-2014, 03:10 PM   #6
rdx
Member
 
Registered: Apr 2007
Location: Dallas
Distribution: Slackware64 14.2
Posts: 274

Original Poster
Rep: Reputation: 25
"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
 
1 members found this post helpful.
Old 03-04-2014, 03:42 PM   #7
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_12{.0|.1}
Posts: 5,493
Blog Entries: 11

Rep: Reputation: 3465Reputation: 3465Reputation: 3465Reputation: 3465Reputation: 3465Reputation: 3465Reputation: 3465Reputation: 3465Reputation: 3465Reputation: 3465Reputation: 3465
Quote:
Originally Posted by rdx View Post
"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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 02:52 AM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. SpellChainz Linux - Software 3 06-28-2007 12:46 PM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. SpellChainz Linux - Newbie 1 06-23-2007 04:35 PM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 09:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:26 AM.

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