[mythtv-users] BE3 - Issues with installation and database
Stephen Worthington
stephen_agent at jsw.gen.nz
Wed May 15 06:03:43 UTC 2019
On Tue, 14 May 2019 11:11:19 -0500, you wrote:
>
>Hi Stephen!
>
>
>Firstly, *thank you*! Secondly, ran into some problems. Comments in-line
>with your instructions so you can see (or at least try to figure out
><g>) my thought processes and what I did. Your instructions are
>outdented, mine (BJM) are indented and in a rectangle, or at least at
>this point they are the original is written using LibreOffice and
>copied to be posted to the Forum.
>
>
>
>To bring up a new MythTV system on Ubuntu 18.04, I recommend not using
>MySQL but switching the database to MariaDB before installing the MythTV
>packages. MySQL now has several problems that you need to overcome
>before it will work properly with MythTV, but I think MariaDB, as
>installed from the packages, is more compatible. So what you do is first
>choose which variant of Ubuntu you want to install. Xubuntu is the
>closest to what Mythbuntu used to be, so I would suggest using that as
>the base system, but ordinary Ubuntu and Lubuntu also work. Install
>that, then before you do anything else (including running apt update and
>apt upgrade) install the MariaDB client and server packages. That will
>uninstall the MySQL packages, and install MariaDB as a direct and fully
>compatible replacement. If you already have MythTV installed, due to the
>dependencies of the MythTV packages, they will be uninstalled also.
>
> BJM Notes:
>
> Already have Ubuntu 18.04 installed; have done several updates/upgrades.
>
>
> Per Terminal with mariadb ==> not installed, use:
>
> sudo apt install mariadb-client-core-10.1 <== core only, so
>
> sudo apt install mariadb-server (per Googling)
>
>
> Install of mariadb indicated mysql old data to /var/lib/mysql.*
>
> no such file found
>
> Did find various mysql files should these be manually removed?
>
>
>Now do "apt update" and "apt upgrade" to update all the packages to the
>latest versions.
>Then install the MythTV-fixes repository, and install the latest MythTV
>v30 packages from there.
>
> install the MythTV-fixes repository ==>
>
> ??sudo add-apt-respository ppa:mythbuntu/30
>
> Appears to be
>
>
> Checking this noted a potential problem:
>
> Installation of MythTV with *sudo apt-get install mythtv*
>
> https://www.mythtv.org/wiki/Installing_MythTV_on_Ubuntu ==>
>
> Install Software section:
>
> The packages do the following:
>
> *
>
> Install mythtv software and all prerequisites.
>
> *
>
> Install MySQL database software. <===
>
> *
>
> Create a MySQL database user for MythTV
>
> Yup: says installed MySQL.
MariaDB is fully compatible with MySQL - MythTV can not tell the
difference between them, and MariaDB installs itself using the same
file names as MySQL (eg /usr/sbin/mysqld, /usr/bin/mysql).
>Now look at the */etc/mythtv/config.xml* file. Change the password there
>if you want to, and then set the same password in MariaDB:
>
>*sudo su*
>*mysql*
>
> ERROR 2002 (HY000): Cant connect to local MySQL server through
> socket var/run/mysqld/mysqld.sock (2 No such file or directory)
MariaDB is not running for some reason. You need to look at the log
files:
/var/log/mysql.*
/var/log/mysql/*
especially /var/log/mysql/error.log. There should be error messages
in there that will tell you what is wrong.
Also run these systemd commands and see what they show:
sudo systemctl status mariadb
sudo journalctl --unit=mariadb
Also, since you had already done an install of MythTV before switching
to MariaDB, there will already be a MythTV database in
/var/lib/mysql/mythconverg. It is likely that MariaDB will be
complaining in its log files that it is unable to convert that
database from its MySQL format to MariaDB format. Once you have
MariaDB running, you will need to delete that database and create a
new one. Do this only after you have found out why MariaDB is not
running and fixed that.
There is a file here:
/usr/share/mythtv/sql/mc.sql
which is used to create a new mythconverg database. Take a copy of
the file somewhere you can edit it, for example:
sudo cp -a /usr/share/mythtv/sql/mc.sql /tmp/mc.sql
then edit the copy and make some changes. Use your favourite editor,
or nano:
sudo nano /tmp/mc.sql
At the start of the file, add this line:
DROP DATABASE IF EXISTS mythconverg;
In the clause
IDENTIFIED BY "mythtv";
change "mythtv" to be the password in your /etc/mythtv/config.xml
file.
Then shut down mythbackend, if it is running:
sudo systemctl stop mythtv-backend
Make sure MariaDB is running:
sudo systemctl status mariadb
Then run these commands:
sudo mysql
source /tmp/mc.sql
quit
That should delete the old database and create a new mythconverg
database and set it up correctly. But will not create all the tables
in the database. When you start mythbackend:
sudo systemctl start mythtv-backend
that should then create and populate all the tables used by
mythbackend. The next time you run mythfrontend, it should create and
populate all the tables used only by mythfrontend and its frontend
only plugins (such as mythmusic).
As an alternative to running mythbackend, if you run mythtv-setup, it
should also create all the backend database tables.
>*grant all on mythconverg.* to mythtv@"%" identified by "<password>";*
>
>(BJM) I stopped at this point as received the response indicating
>command grant not found. At that point was in a deeper Terminal
>command level root at Backend-3 vs. barry- at Backend-3. At the
>barry at Backend-3 <mailto:barry at Backend-3> prompt checked grant help:
>not found. Guessing grant is a MySQL command but not loading because
>of the socket error.
>
>LIS, checked a couple things then stopped at this point to ask for help.
>BTW, the /etc/mythtv/config.xml file contained the same random password
>as (my) yesterday. Thought that a hare odd as when uninstalled MySQL
>previously (before asking for help) the new install of MythTV changed
>the original password (of install #1). Just in case that bit of trivia
>is significant.
Uninstalling a package does not uninstall any data files created by
that package, or files created when that software was run. If you use
apt-get purge instead of apt-get remove, that will remove the data
files created by the package (such as /etc/mythtv/* files). So
reinstalling a package without a prior purge will leave the old files
from the previous install and you will still have the old
/etc/mythtv/config.xml with the old password in it.
More information about the mythtv-users
mailing list