1

We recently picked up a client that has a site hosted on a FreeBSD box. The stack is FAMP. Things were chugging along just fine until recently mysql seems to have stopped running.

There is no mysql log under /var/log/mysql.log.

service mysql-server status says mysql is not running.

service mysql-server start says Starting mysql. but it doesn't actually start.

Where do I start to find out what happened and how to get mysql up and running again?

4
  • How familiar are you with FreeBSD?
    – EEAA
    Dec 9, 2015 at 21:30
  • This is literally the first instance of FreeBSD I've ever touched. Dec 9, 2015 at 21:41
  • you need to locate log (and my.cnf) to see actual error why it's wouldn't start...
    – alexus
    Dec 9, 2015 at 21:54
  • The problem can be replicated by installing FreeBSD 11.2 and mariadb103-server OOTB. find / -name "my.cnf" returns nothing.
    – user441987
    Jul 30, 2018 at 21:13

2 Answers 2

1

The default location for the log file (which usually has a .err extension) is the same place as the database, which defaults to /var/db/mysql/.

But of course all of these can be changed in the master configuration file my.cnf which mysqld will look for in a number of locations including /etc/.

You may need to locate it with:

find / -name "my.cnf"

Also, check /etc/rc.conf as it may contain some command line parameters used when starting the service.

2
  • I'm currently downloading a 3.5 gb .err file now to examine what is going on... Dec 9, 2015 at 21:57
  • 1
    You probably only need the last few dozen lines. Dec 9, 2015 at 22:02
0

Please note. When installing MySQL or any variant that it does not give you a default "my.cnf" file. It's called "my.cnf.sample" So running find / -name "my.cnf" is not going to find it for you.

[2010][root@reaper ~ ] # find / -name "my.cnf"
/usr/local/my.cnf
[2010][root@reaper ~ ] # find / -name "my.cnf*"
/usr/local/etc/mysql/my.cnf.sample
/usr/local/my.cnf

Many config files work the same way for services installed on FreeBSD.

The reason my system is returning a my.cnf file is because I had already taken the sample file, moved it to /usr/local/ and renamed it my.cnf and then made the edits I needed to.

2
  • Do you have a reason to think that is why mysql stops running?
    – RalfFriedl
    Jan 21, 2020 at 17:03
  • Could be a number of things that stop it from running. Would need to see the error log to determine what's going on. And that information was never given.
    – Y12IF
    Jan 22, 2020 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.