LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-04-2018, 08:25 AM   #1
DennyY
Member
 
Registered: May 2018
Location: San Francisco, CA
Distribution: CentOS 7
Posts: 77

Rep: Reputation: 1
Question files are missing from /var/run/mysqld


Hi All,

So I have been having trouble installing MySQL on my DHCP server. And I finally noticed that these files are missing from /var/run/mysqld:

mysqld.pid mysqlx.sock mysqlx.sock.lock

I did try to reinstall it and those files are still missing.

But it's funny that I did the SAME installation on my DHCP client, and MySQL is up and running. And I have been using it. (This is how I found out these 3 files are missing)

And now I'm still having trouble installing MySQL on my DHCP server. These files are still missing.

I don't think I can create these 3 files manually? Or I need to find another .rpm file and see if it will work?

I am running DHCP server on CentOS 7.

Thanks again,
Denny
 
Old 06-04-2018, 08:37 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,715
Blog Entries: 13

Rep: Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937
Files in /var/run do not come from installation, they come from a running process or service.

Something is not working where the service is not starting properly, or not continuing to run.

There are likely application logs as well as system logs which will indicate problems starting or running it. Please look for those logs.

Edit Addition: Or perhaps you have never run the server as yet. Please check to see how you are starting it.

Last edited by rtmistler; 06-04-2018 at 08:38 AM.
 
Old 06-04-2018, 08:44 AM   #3
DennyY
Member
 
Registered: May 2018
Location: San Francisco, CA
Distribution: CentOS 7
Posts: 77

Original Poster
Rep: Reputation: 1
Question missing files from /etc/run/mysqld

Hi,

Thank you for the reply.

So I re-installed MYSQL and this is what I get:

[root@localhost /]# systemctl enable mysqld
[root@localhost /]# systemctl restart mysqld
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
[root@localhost /]# systemctl -l status mysqld
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sat 2018-06-02 19:41:12 PDT; 7s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 24722 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS (code=exited, status=1/FAILURE)
Process: 24633 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 24722 (code=exited, status=1/FAILURE)
Status: "SERVER_BOOTING"
Error: 2 (No such file or directory)

Jun 02 19:41:10 localhost.Uriah systemd[1]: Starting MySQL Server...
Jun 02 19:41:12 localhost.Uriah systemd[1]: mysqld.service: main process exited, code=exited, status=1/FAILURE
Jun 02 19:41:12 localhost.Uriah systemd[1]: Failed to start MySQL Server.
Jun 02 19:41:12 localhost.Uriah systemd[1]: Unit mysqld.service entered failed state.
Jun 02 19:41:12 localhost.Uriah systemd[1]: mysqld.service failed.


#####my.cnf#####
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

How can I fix this issue with those missing files?

Thank you,
Denny








Quote:
Originally Posted by rtmistler View Post
Files in /var/run do not come from installation, they come from a running process or service.

Something is not working where the service is not starting properly, or not continuing to run.

There are likely application logs as well as system logs which will indicate problems starting or running it. Please look for those logs.

Edit Addition: Or perhaps you have never run the server as yet. Please check to see how you are starting it.
 
Old 06-04-2018, 09:29 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,715
Blog Entries: 13

Rep: Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937
You keep focusing on those files in the /var/run tree, however the service is not starting.
Code:
Status: "SERVER_BOOTING"
Error: 2 (No such file or directory)
The Error: 2 complaint seems to be saying that the service is looking for a configuration file or executable and it does not find it. The PID, SOCK, and LOCK files are not going to be created until the service starts successfully. Unfortunately I'm no MySQL expert so I don't really know how it starts and gets configured. You may have directory permissions which are a problem, or a missing configuration file/executable. I'd guess executable or the path to it is incorrect. Because likely you're running this service as root, and also it is likely designed to perform a default configuration if there is no configuration file found.
 
1 members found this post helpful.
Old 06-04-2018, 04:04 PM   #5
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.8.2003
Posts: 4,842

Rep: Reputation: 1766Reputation: 1766Reputation: 1766Reputation: 1766Reputation: 1766Reputation: 1766Reputation: 1766Reputation: 1766Reputation: 1766Reputation: 1766Reputation: 1766
OP: Please use code tags when posting code, config files or output...

Does
Code:
/usr/sbin/mysqld
exist?
If not, run
Code:
which mysqld
to identify the location of the mysqld binary and tell us where it is, please.
 
1 members found this post helpful.
Old 06-04-2018, 04:59 PM   #6
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,230

Rep: Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724
Is there something in /var/log/mysqld.log ?
 
Old 06-04-2018, 09:47 PM   #7
DennyY
Member
 
Registered: May 2018
Location: San Francisco, CA
Distribution: CentOS 7
Posts: 77

Original Poster
Rep: Reputation: 1
Question /sbin/mysqld

Hi,

Mine is /sbin/mysqld

Thank you,
Denny




Quote:
Originally Posted by scasey View Post
OP: Please use code tags when posting code, config files or output...

Does
Code:
/usr/sbin/mysqld
exist?
If not, run
Code:
which mysqld
to identify the location of the mysqld binary and tell us where it is, please.
 
Old 06-04-2018, 10:56 PM   #8
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,715
Blog Entries: 13

Rep: Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937
Nice catch scasey.

DennyY do you understand the problem?

Your log shows it trying to start from, /usr/sbin

However you've just posted that the executable is located in /sbin
 
Old 06-04-2018, 11:00 PM   #9
DennyY
Member
 
Registered: May 2018
Location: San Francisco, CA
Distribution: CentOS 7
Posts: 77

Original Poster
Rep: Reputation: 1
Question /usr/bin and /sbin for mysqld

Hello,

Yes, I do understand the problem. But how do I fix these executable files?

Thank you for your help,
Denny



Quote:
Originally Posted by rtmistler View Post
Nice catch scasey.

DennyY do you understand the problem?

Your log shows it trying to start from, /usr/sbin

However you've just posted that the executable is located in /sbin
 
Old 06-05-2018, 12:53 AM   #10
DennyY
Member
 
Registered: May 2018
Location: San Francisco, CA
Distribution: CentOS 7
Posts: 77

Original Poster
Rep: Reputation: 1
Question SELInux and MySQL

Hi,

I don't know much about SELinux, but this message popped out while I was trying to restart mysqld:

SELinux is preventing /usr/sbin/mysqld from using the sys_nice capability.

Thanks again,
Denny





Quote:
Originally Posted by scasey View Post
OP: Please use code tags when posting code, config files or output...

Does
Code:
/usr/sbin/mysqld
exist?
If not, run
Code:
which mysqld
to identify the location of the mysqld binary and tell us where it is, please.
 
Old 06-05-2018, 10:59 AM   #11
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
You can disable SElinux for testing
Code:
$ /usr/sbin/setenforce 0
 
Old 06-05-2018, 05:40 PM   #12
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.8.2003
Posts: 4,842

Rep: Reputation: 1766Reputation: 1766Reputation: 1766Reputation: 1766Reputation: 1766Reputation: 1766Reputation: 1766Reputation: 1766Reputation: 1766Reputation: 1766Reputation: 1766
Quote:
Originally Posted by DennyY View Post
Hello,

Yes, I do understand the problem. But how do I fix these executable files?

Thank you for your help,
Denny
There is apparently a mis-match between the installation and the systemd init file for mysqld.
How did you install mysql? What might you have done that caused the mis-match?
 
Old 06-07-2018, 12:26 AM   #13
DennyY
Member
 
Registered: May 2018
Location: San Francisco, CA
Distribution: CentOS 7
Posts: 77

Original Poster
Rep: Reputation: 1
Question Installing MySQL

Hi,

I did the same installation on both my DHCP sever and the client. But MySQL works fine on my client, but not the server. And I have no idea why and how this error is there.

I have also tried to reisntstall 3 times, and the same error occurred each time.

Any ideas?

Thank you,
Denny


Quote:
Originally Posted by scasey View Post
There is apparently a mis-match between the installation and the systemd init file for mysqld.
How did you install mysql? What might you have done that caused the mis-match?
 
Old 06-07-2018, 07:40 AM   #14
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,715
Blog Entries: 13

Rep: Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937
I agree that a proper installation should not leave you in a situation where the service files are incorrect.

Meanwhile, why not edit the files which start the service so that they point to the correct executable file and correct directories?
 
1 members found this post helpful.
Old 06-07-2018, 08:25 AM   #15
DennyY
Member
 
Registered: May 2018
Location: San Francisco, CA
Distribution: CentOS 7
Posts: 77

Original Poster
Rep: Reputation: 1
Question DHCP server and client

Hi,

Thank you all for your help trying to resolve my MySQL issue.

As for now, I am going to leave it alone, since MySQL works on my DHCP client. I don't want to waste any more time.

Will there a conflict if I also install Apache, and php on the client, since the server also have those applications?

Thanks again,
Denny






Quote:
Originally Posted by rtmistler View Post
I agree that a proper installation should not leave you in a situation where the service files are incorrect.

Meanwhile, why not edit the files which start the service so that they point to the correct executable file and correct directories?
 
  


Reply

Tags
mysqld


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
mysqld from pid file /var/run/mysqld/mysqld.pid ended gabsik Linux - Server 3 12-11-2016 10:15 AM
[SOLVED] /run/var is missing percy_vere_uk Linux From Scratch 4 06-23-2015 08:26 AM
[SOLVED] MySQL Start Problem::::socket '/var/run/mysqld/mysqld.sock' (2) arun-linux Linux - Software 6 11-29-2012 06:56 AM
[SOLVED] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' Burningmace Linux - Server 5 09-06-2012 01:29 AM
Can't connect to local MySql server through socket '/var/run/mysqld/mysqld.sock' (2) thoufiq Linux - Server 4 04-19-2011 04:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:17 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration