LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   mysqld failed to start (https://www.linuxquestions.org/questions/linux-newbie-8/mysqld-failed-to-start-4175549377/)

shellyd34 07-30-2015 12:46 PM

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

yancek 07-30-2015 01:02 PM

Which Linux distribution are you using and how are you trying to start mysqld?

shellyd34 07-30-2015 01:48 PM

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.

astrogeek 07-30-2015 01:57 PM

Quote:

Originally Posted by shellyd34 (Post 5398469)
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?

shellyd34 07-30-2015 02:46 PM

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)

shellyd34 07-30-2015 02:49 PM

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

astrogeek 07-30-2015 03:02 PM

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.

astrogeek 07-30-2015 03:12 PM

Quote:

Originally Posted by shellyd34 (Post 5398499)
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?

shellyd34 07-30-2015 03:19 PM

can you tell me how to use the code tag?

shellyd34 07-30-2015 03:21 PM

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.


shellyd34 07-30-2015 03:22 PM

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


astrogeek 07-30-2015 03:25 PM

Quote:

Originally Posted by shellyd34 (Post 5398522)
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!

astrogeek 07-30-2015 03:29 PM

STOP!

Quote:

Originally Posted by shellyd34 (Post 5398531)
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?

shellyd34 07-30-2015 03:31 PM

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

astrogeek 07-30-2015 03:42 PM

Quote:

Originally Posted by shellyd34 (Post 5398540)
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.


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