LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 07-30-2015, 12:46 PM   #1
shellyd34
LQ Newbie
 
Registered: Jul 2015
Posts: 12

Rep: Reputation: Disabled
mysqld failed to start


I am trying to start mysqld and it keeps telling me it FAILED. I can't figure out what to do to fix it. This is what it tells me.

Starting mysqld (via systemctl): Job failed. See system logs and 'systemctl status' for details.
[FAILED]

Can anyone help?

Shelly
 
Old 07-30-2015, 01:02 PM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,539

Rep: Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496Reputation: 2496
Which Linux distribution are you using and how are you trying to start mysqld?
 
Old 07-30-2015, 01:48 PM   #3
shellyd34
LQ Newbie
 
Registered: Jul 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
I am using Fedora 15 and I am trying to start my SQL using code: sudo service mysqld start and it keeps telling me it failed. I have tried everything.
 
Old 07-30-2015, 01:57 PM   #4
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196
Quote:
Originally Posted by shellyd34 View Post
I am using Fedora 15 and I am trying to start my SQL using code: sudo service mysqld start and it keeps telling me it failed. I have tried everything.
So what have you tried, "everything" is not really enough to go on...?

Does that include:

Code:
Starting mysqld (via systemctl): Job failed. See system logs and 'systemctl status' for details.
[FAILED]
If so, what did they say?
 
Old 07-30-2015, 02:46 PM   #5
shellyd34
LQ Newbie
 
Registered: Jul 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
this is what it tells me

[shellyd34@localhost ~]$ sudo service mysqld start
Starting mysqld (via systemctl): Job failed. See system logs and 'systemctl status' for details.
[FAILED]
I also tried this and got this

[shellyd34@localhost ~]$ mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
 
Old 07-30-2015, 02:49 PM   #6
shellyd34
LQ Newbie
 
Registered: Jul 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
I also have done this

[shellyd34@localhost ~]$ rpm -q mysql-server
mysql-server-5.5.23-1.fc15.i686

[shellyd34@localhost ~]$ /var/log/mysqld.log
bash: /var/log/mysqld.log: Permission denied
 
Old 07-30-2015, 03:02 PM   #7
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196
s/everything/nothing/g

Please use [CODE]...[/CODE] tags around your pasted info to help make it more readable.

Since you still have not looked in the logs, I'll have to guess... my guess would be that you have never initialized the mysql database.

See...

Code:
man mysql_install_db
... or find help here: mysql_install_db

I am not a Fedora user, but typically you just need to run:

Code:
mysql_install_db --user=mysql
The mysql user must already exist (probably does). Try that and see what it says.
 
Old 07-30-2015, 03:12 PM   #8
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196
Quote:
Originally Posted by shellyd34 View Post
I also have done this

[shellyd34@localhost ~]$ rpm -q mysql-server
mysql-server-5.5.23-1.fc15.i686

[shellyd34@localhost ~]$ /var/log/mysqld.log
bash: /var/log/mysqld.log: Permission denied
So have you tried to look into the log as root so that you will have the right permission?
 
Old 07-30-2015, 03:19 PM   #9
shellyd34
LQ Newbie
 
Registered: Jul 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
can you tell me how to use the code tag?

Last edited by shellyd34; 07-30-2015 at 03:27 PM.
 
Old 07-30-2015, 03:21 PM   #10
shellyd34
LQ Newbie
 
Registered: Jul 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
When I put in the code this is what it said

Code:
[shellyd34@localhost ~]$ mysql_install_db --user=mysql
chown: changing ownership of `/var/lib/mysql': Operation not permitted
Cannot change ownership of the database directories to the 'mysql'
user.  Check that you have the necessary permissions and try again.
 
Old 07-30-2015, 03:22 PM   #11
shellyd34
LQ Newbie
 
Registered: Jul 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
I guess I changed ownership when I did this code

Code:
[shellyd34@localhost ~]$ sudo chown mysql:mysql /var/log/ -chR
after I ran that code this is what it said

Code:
changed ownership of `/var/log/ppp' to mysql:mysql
changed ownership of `/var/log/messages' to mysql:mysql
changed ownership of `/var/log/vmware-tools-upgrader.log' to mysql:mysql
changed ownership of `/var/log/cron' to mysql:mysql
changed ownership of `/var/log/tallylog' to mysql:mysql
changed ownership of `/var/log/wtmp' to mysql:mysql
changed ownership of `/var/log/gdm/:0.log.1' to mysql:mysql
changed ownership of `/var/log/gdm/:0-greeter.log.4' to mysql:mysql
changed ownership of `/var/log/gdm/:0-slave.log.2' to mysql:mysql
changed ownership of `/var/log/gdm/:0-slave.log.3' to mysql:mysql
changed ownership of `/var/log/gdm/:0-slave.log.1' to mysql:mysql
changed ownership of `/var/log/gdm/:0-greeter.log.2' to mysql:mysql
changed ownership of `/var/log/gdm/:0.log' to mysql:mysql
changed ownership of `/var/log/gdm/:0-greeter.log.1' to mysql:mysql
changed ownership of `/var/log/gdm/:0.log.4' to mysql:mysql
changed ownership of `/var/log/gdm/:0.log.3' to mysql:mysql
changed ownership of `/var/log/gdm/:0-greeter.log' to mysql:mysql
changed ownership of `/var/log/gdm/:0.log.2' to mysql:mysql
changed ownership of `/var/log/gdm/:0-slave.log.4' to mysql:mysql
changed ownership of `/var/log/gdm/:0-slave.log' to mysql:mysql
changed ownership of `/var/log/gdm/:0-greeter.log.3' to mysql:mysql
changed ownership of `/var/log/gdm' to mysql:mysql
changed ownership of `/var/log/secure-20150727' to mysql:mysql
changed ownership of `/var/log/Xorg.0.log' to mysql:mysql
changed ownership of `/var/log/pm-powersave.log' to mysql:mysql
changed ownership of `/var/log/cron-20150727' to mysql:mysql
changed ownership of `/var/log/messages-20150727' to mysql:mysql
changed ownership of `/var/log/btmp' to mysql:mysql
changed ownership of `/var/log/secure' to mysql:mysql
changed ownership of `/var/log/anaconda/anaconda.log' to mysql:mysql
changed ownership of `/var/log/anaconda/anaconda.syslog' to mysql:mysql
changed ownership of `/var/log/anaconda/anaconda.program.log' to mysql:mysql
changed ownership of `/var/log/anaconda/anaconda.yum.log' to mysql:mysql
changed ownership of `/var/log/anaconda/anaconda.ifcfg.log' to mysql:mysql
changed ownership of `/var/log/anaconda/anaconda.xlog' to mysql:mysql
changed ownership of `/var/log/anaconda/anaconda.storage.log' to mysql:mysql
changed ownership of `/var/log/anaconda' to mysql:mysql
changed ownership of `/var/log/ntpstats' to mysql:mysql
changed ownership of `/var/log/mail/statistics' to mysql:mysql
changed ownership of `/var/log/mail' to mysql:mysql
changed ownership of `/var/log/boot.log-20150727' to mysql:mysql
changed ownership of `/var/log/maillog-20150727' to mysql:mysql
changed ownership of `/var/log/spooler' to mysql:mysql
changed ownership of `/var/log/speech-dispatcher' to mysql:mysql
changed ownership of `/var/log/boot.log' to mysql:mysql
changed ownership of `/var/log/Xorg.0.log.old' to mysql:mysql
changed ownership of `/var/log/spooler-20150727' to mysql:mysql
changed ownership of `/var/log/lastlog' to mysql:mysql
changed ownership of `/var/log/yum.log' to mysql:mysql
changed ownership of `/var/log/prelink/prelink.log' to mysql:mysql
changed ownership of `/var/log/prelink' to mysql:mysql
changed ownership of `/var/log/ConsoleKit/history' to mysql:mysql
changed ownership of `/var/log/ConsoleKit' to mysql:mysql
changed ownership of `/var/log/maillog' to mysql:mysql
changed ownership of `/var/log/dracut.log' to mysql:mysql
changed ownership of `/var/log/audit/audit.log' to mysql:mysql
changed ownership of `/var/log/audit' to mysql:mysql
changed ownership of `/var/log/sssd' to mysql:mysql
changed ownership of `/var/log/' to mysql:mysql

Last edited by shellyd34; 07-30-2015 at 03:24 PM.
 
Old 07-30-2015, 03:25 PM   #12
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196
Quote:
Originally Posted by shellyd34 View Post
can you tell me how to use the code tag?
Sure, you can simply type [CODE]...[/CODE] around the pasted text. Or in the editor box you can hilight the selected text by click-drag then click on the # icon at top. If you do not see the # icon, click Go Advanced at bottom to get to all the options.

Doing so makes pasted code much more readable and preserves indentation, etc... thanks for trying!
 
Old 07-30-2015, 03:29 PM   #13
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196
STOP!

Quote:
Originally Posted by shellyd34 View Post
I guess I changed ownership when I did this code

Code:
[shellyd34@localhost ~]$ sudo chown mysql:mysql /var/log/ -chR
Why did you do that?! You DEFINITELY do not want to change all logs to mysql:mysql!

That is definitely going to break many things!

DO NOT DO ANYTHING ELSE until you get these fixed - and there is not a simple way to fix it because many logs are not owned by root but by their process owners...

Why did you do that?

Last edited by astrogeek; 07-30-2015 at 03:30 PM.
 
Old 07-30-2015, 03:31 PM   #14
shellyd34
LQ Newbie
 
Registered: Jul 2015
Posts: 12

Original Poster
Rep: Reputation: Disabled
how can I fix it?

---------- Post added 07-30-15 at 03:31 PM ----------

I did it because I didn't know what I was doing
 
Old 07-30-2015, 03:42 PM   #15
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196
Quote:
Originally Posted by shellyd34 View Post
how can I fix it?

I did it because I didn't know what I was doing
I do not mean this unkindly, but obviously so! Please stay away from heavy weapons and aircraft controls!

Is this a production machine or your own learning machine?

If a production machine then you will need to quickly find out what user normally owns what logs and change them back individualy, maybe from your backups. Many will be owned by root, but simply resetting all to root will break others and is also a huge security risk in some cases.

If you have the install media and another machine or VM to install to, I might suggest doing a quick installation then looking into /var/log to get most of the ownerships.

Or if there is another Fedora user here willing to volunteer the ownerships from their system you could reset many that way.

If this is a learning machine without much stuff on it, a quick reinstall might be easiest.

And be sure to note my own first two rules of troubleshooting:

Quote:
1. NEVER do anything until you have a good reason - don't push buttons or type commands without knowledge!
2. ALWAYS know what you expect to happen next - if it does you gain ground, if it doesn't you can at least understand why.

Last edited by astrogeek; 07-30-2015 at 03:48 PM.
 
  


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
mysqld and selinux? cant start mysqld willc86 Linux - Software 1 04-11-2015 09:19 AM
[SOLVED] cannot start mysqld? michaelinux Slackware 3 03-24-2014 02:01 PM
[SOLVED] MySQL Start Problem::::socket '/var/run/mysqld/mysqld.sock' (2) arun-linux Linux - Software 6 11-29-2012 06:56 AM
mysqld failed. the error was: initializing MySQL database. avnat Linux - Newbie 5 03-18-2011 11:58 PM
Cannot start mysqld peace18 Linux - Newbie 1 03-09-2011 02:17 AM

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

All times are GMT -5. The time now is 07:28 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