Updated to El Capitan 10.11.5 no database (Solved)

For discussion of topics specific to MythTV on OSX
Post Reply
rbmisc
Junior
Posts: 93
Joined: Tue Nov 04, 2014 3:55 am
United States of America

Updated to El Capitan 10.11.5 no database (Solved)

Post by rbmisc »

I just updated to the latest El Capitan and now MySql database isn't being detected by MythTV. How do I get my database back? I do have a backup. Just need to know how to restore it.

Update: I was able to get Mysql database started again. Just wondering why the update stopped the database.
Last edited by rbmisc on Tue Jun 21, 2016 3:38 pm, edited 4 times in total.
User avatar
pvr4me
Senior
Posts: 764
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: Updated to El Capitan 10.11.5 no database (Resolved)

Post by pvr4me »

You may be able to tell what happened by looking at the logs. Two places to try:

1) Console.app (/Applications/Utilities). Use the filter box to look for any entries for 'mysql' or 'maria'.

2) Look in '/opt/dvr/var/db/mariadb' for a file with the extension '.err'.

Craig
Formerly the MacPorts guy.
rbmisc
Junior
Posts: 93
Joined: Tue Nov 04, 2014 3:55 am
United States of America

Re: Updated to El Capitan 10.11.5 no database

Post by rbmisc »

Hi Craig,

I had the issue again with mysql not starting after power cycling my computer.

Here is a snippet from the localhost.err in that you suggested looking into.
I powered the computer back on at the early time. The safe start was done by me manually.
What needs to be done for mysql to start automatically when I power up?

The only entries in the Console.app were for the manual ones I did.

Code: Select all

160619  6:45:58 [Note] Event Scheduler: Purging the queue. 0 events
160619  6:45:58  InnoDB: Starting shutdown...
160619  6:45:58  InnoDB: Shutdown completed; log sequence number 10136621
160619 17:37:56 mysqld_safe Starting mysqld daemon with databases from /opt/dvr/var/db/mariadb
160619 17:37:56 [Warning] Setting lower_case_table_names=2 because file system for /opt/dvr/var/db/mariadb/ is case insensitive
160619 17:37:56 InnoDB: The InnoDB memory heap is disabled
160619 17:37:56 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160619 17:37:56 InnoDB: Compressed tables use zlib 1.2.8
160619 17:37:56 InnoDB: Initializing buffer pool, size = 128.0M
160619 17:37:56 InnoDB: Completed initialization of buffer pool
160619 17:37:56 InnoDB: highest supported file format is Barracuda.
160619 17:37:57  InnoDB: Waiting for the background threads to start
160619 17:37:58 Percona XtraDB (http://www.percona.com) 5.5.40-MariaDB-36.1 started; log sequence number 10136621
160619 17:37:58 [Note] Server socket created on IP: '0.0.0.0'.
160619 17:37:58 [Note] Event Scheduler: Loaded 0 events
160619 17:37:58 [Note] /opt/dvr/lib/mariadb/bin/mysqld: ready for connections.
Rick
User avatar
pvr4me
Senior
Posts: 764
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: Updated to El Capitan 10.11.5 no database

Post by pvr4me »

Keep in mind that I am NOT an experienced MySQL database administrator!

It has been a month since your initial report. Was yesterday the first day that the machine was restarted? Or has the db started automatically other times when the system was restarted?

I would think that the most likely cause is that launchd 'doesn't know' that it is supposed to start the database. Please restart the system. If the database doesn't start automatically, then try the following command:

Code: Select all

sudo launchctl load -w /Library/LaunchDaemons/org.macports.mariadb-server.plist 
Please copy/paste the results of that command. If it says something like 'already loaded', then the problem is elsewhere. (And we may have to involve someone who knows more about MariaDB than me!)

Craig
Formerly the MacPorts guy.
rbmisc
Junior
Posts: 93
Joined: Tue Nov 04, 2014 3:55 am
United States of America

Re: Updated to El Capitan 10.11.5 no database

Post by rbmisc »

Hi Craig,

Code: Select all

/opt/local/etc/LaunchDaemons/org.macports.mariadb-server/org.macports.mariadb-server.plist: service already loaded
Rick
User avatar
pvr4me
Senior
Posts: 764
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: Updated to El Capitan 10.11.5 no database

Post by pvr4me »

rbmisc wrote:Hi Craig,

Code: Select all

/opt/local/etc/LaunchDaemons/org.macports.mariadb-server/org.macports.mariadb-server.plist: service already loaded
Please remind me, did you install with the all-in-one installer or have your done your own build with MacPorts? You don't have (parts of) both installed, do you?

Could you please paste the relevant section of MariaDB's log file (from '/opt/dvr/var/db/mariadb' or '/opt/local/var/db/mariadb', as appropriate).

Wild stab, but does daemondo exist ('/opt/local/bin' or ''/opt/dvr/bin')?

Craig
Formerly the MacPorts guy.
rbmisc
Junior
Posts: 93
Joined: Tue Nov 04, 2014 3:55 am
United States of America

Re: Updated to El Capitan 10.11.5 no database

Post by rbmisc »

Way back when I first started installing, I tried installing the mysql using thehttps://www.mythtv.org/wiki/MythTV_on_Mac_OS_X. I don't remember when I ended up going with the all-in-one installer. Most likely when I wasn't successful with the first one. I thought I removed the previous mysql, but it appears I have both installed.

I didn't have any issues with mysql starting from power up in the past. It only occurred after a recent El Capitan update.
User avatar
pvr4me
Senior
Posts: 764
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: Updated to El Capitan 10.11.5 no database

Post by pvr4me »

rbmisc wrote:Way back when I first started installing, I tried installing the mysql using thehttps://www.mythtv.org/wiki/MythTV_on_Mac_OS_X. I don't remember when I ended up going with the all-in-one installer. Most likely when I wasn't successful with the first one. I thought I removed the previous mysql, but it appears I have both installed.

I didn't have any issues with mysql starting from power up in the past. It only occurred after a recent El Capitan update.
I glanced through the message history and it appears that you originally had mysql problems. Eg:

viewtopic.php?f=26&t=418&p=2212#p2212

PLUS, the above shows that launchd is looking for the MariaDB plist in /opt/local/... The '/opt/local' prefix is used when building your own software with MacPorts. The all-in-one installer puts MythTV under '/opt/dvr'.

I don't normally recommend this, but I think your best course of action might be to nuke and pave! Make a database backup or two, first, then wipe the disk. Then choose _one_ approach to installing Myth and stick with it. Restore your database backup and you should be able to go forward without losing any recordings or rules.

https://www.mythtv.org/wiki/MacPorts#Database_Migration

Craig
Formerly the MacPorts guy.
rbmisc
Junior
Posts: 93
Joined: Tue Nov 04, 2014 3:55 am
United States of America

Re: Updated to El Capitan 10.11.5 no database (Solved)

Post by rbmisc »

Hi Craig,

I thought I would try something else before I did what you recommended. I deleted com.mysql.mysql.plist from /Library/LaunchDaemons/. The mysql in/opt/dvr/vardb/mariadb/is the only one starting automatically now. I still have the issue with the mythbackend not starting. I don't know if there is a timing issue that the mysql doesn't get started before mythbackend starts. But the backend finally starts.

So thanks for you suggestions.
User avatar
pvr4me
Senior
Posts: 764
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: Updated to El Capitan 10.11.5 no database (Solved)

Post by pvr4me »

rbmisc wrote:I thought I would try something else before I did what you recommended. I deleted com.mysql.mysql.plist from /Library/LaunchDaemons/. The mysql in/opt/dvr/vardb/mariadb/is the only one starting automatically now. I still have the issue with the mythbackend not starting. I don't know if there is a timing issue that the mysql doesn't get started before mythbackend starts. But the backend finally starts.
Yeah, it happens to me too. Sometimes launchd tries to start mythbackend before the database is (fully?) ready. launchd will automatically retry mythbackend every 5 minutes in such cases so it really is a temporary problem. I'll try to find a cleaner solution in the next update...but no promises.

Craig
Formerly the MacPorts guy.
rbmisc
Junior
Posts: 93
Joined: Tue Nov 04, 2014 3:55 am
United States of America

Re: Updated to El Capitan 10.11.5 no database

Post by rbmisc »

Craig,

I'm getting frustrated with mysql. I had to power off my computer and now I get the error message RROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/dvr/var/run/mariadb/mysqld.sock' (2). I don't even see anything in /opt/dvr/var/run/mariadb/mysqld.sock. Is this file supposed to be generated when the system starts up? The plist for mariadb-server is loaded. Just no mysqld.sock.

My mythTV is dead in the water again. Would it be better for me to un-install Macports MythTv and re-install to see if that fixes it? If so, then what is the procedure to uninstall?

Rick
User avatar
pvr4me
Senior
Posts: 764
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: Updated to El Capitan 10.11.5 no database

Post by pvr4me »

rbmisc wrote:I'm getting frustrated with mysql. I had to power off my computer and now I get the error message RROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/dvr/var/run/mariadb/mysqld.sock' (2). I don't even see anything in /opt/dvr/var/run/mariadb/mysqld.sock. Is this file supposed to be generated when the system starts up? The plist for mariadb-server is loaded. Just no mysqld.sock.

My mythTV is dead in the water again. Would it be better for me to un-install Macports MythTv and re-install to see if that fixes it? If so, then what is the procedure to uninstall?
Well, the good news is that it is almost certainly a permissions problem. The database software creates the socket 'file' (mysql.sock) when it is starting up and uses that to communicate with other programs.

Are you letting launchd start up MariaDB? Or are you issuing the safe start command in Terminal?

Please past the output from 'sudo ls -al /opt/dvr/var/run/mariadb/'. That directory should be owned by user "_mysql" with read/write privileges.

At this point, reinstalling _only_ Myth would be a waste of time. I'm pretty sure you need to nuke-n-pave your system to get rid of any vestiges of other attempted installs.

Craig
Formerly the MacPorts guy.
rbmisc
Junior
Posts: 93
Joined: Tue Nov 04, 2014 3:55 am
United States of America

Re: Updated to El Capitan 10.11.5 no database (Solved)

Post by rbmisc »

Craig,

Thanks for getting back to me. Here is what I have.

Code: Select all

total 0
drwxr-xr-x  3 _mysql  _mysql  102 Jun 29 19:04 .
drwxr-xr-x  6 root    admin   204 Nov 21  2014 ..
-rw-r--r--  1 root    _mysql    0 Mar 20  2015 .turd_mariadb-server
Rick
User avatar
pvr4me
Senior
Posts: 764
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: Updated to El Capitan 10.11.5 no database

Post by pvr4me »

OK, but...
pvr4me wrote:...Are you letting launchd start up MariaDB? Or are you issuing the safe start command in Terminal?

...

At this point, reinstalling _only_ Myth would be a waste of time. I'm pretty sure you need to nuke-n-pave your system to get rid of any vestiges of other attempted installs.
Craig
Formerly the MacPorts guy.
rbmisc
Junior
Posts: 93
Joined: Tue Nov 04, 2014 3:55 am
United States of America

Re: Updated to El Capitan 10.11.5 no database (Solved)

Post by rbmisc »

Craig,

Again, I was not ready to nuke my system. I did more searching and found that I didn't delete the mariadb-server plist for the mysql that I installed. I also renamed all of the mariadb folders for the previously installed mysql as well as deleting the mariadb-server plist for this one and mythtv's mysql is again running.

Rick
Post Reply