[mythtv-users] Problem with mythconverg_restore.pl
Michael T. Dean
mtdean at thirdcontact.com
Thu Aug 5 12:43:49 UTC 2021
On 08/04/2021 04:09 PM, Gary Buhrmaster wrote:
> On Wed, Aug 4, 2021 at 6:35 PM David Hampton via mythtv-users wrote:
>
>> Leave off the --drop_database argument. This is a new install of mysql,
>> so there's no mythconverg database to drop.
>>
> While my recollection of the script was that
> it tried to verify that the database does not
> exist before attempting to drop it (so one
> should not have run into the issue), perhaps
> the "drop database" stmt should be
> enhanced with a "if exists" mysql/mariadb
> extension which would let processing
> proceed.
>
> Would that be a "good first issue" for a
> new contributor pull request?
The script connects to the database by name to check if it exists. If
that succeeds, we assume the database (to which we successfully
connected) actually exists ;). If it exists and if --drop_database was
specified, the script will do a DROP DATABASE.
However, the actual error in the OP's case was not that the database
does not exist. It was:
>>> DBD::mysql::st execute failed: Schema directory './mythconverg/'
>>> does not exist at /usr/share/mythtv/mythconverg_restore.pl
>>> <http://mythconverg_restore.pl/> line 1052.
>>>
>>> ERROR: Unable to drop database.
>>> Schema directory './mythconverg/' does not exist
which indicates a problem with the MySQL/MariaDB server configuration.
Even if we had an IF EXISTS, there would be a failure when we next
attempt to alter the schema with, for example, CREATE DATABASE.
The relative directory "." seems suspect to me. It seems that someone
has specified an other-than-default MySQL DATA DIRECTORY that's
conflicting with an other-specified DATA DIRECTORY. This could have
been done with the DATADIR environment variable, the --datadir
command-line option to mysqld, or a datadir option in my.cnf (perhaps in
a subsection limiting it to only some programs). Or, the problem may be
a problem with file system permissions meaning that the user running
mysqld doesn't have appropriate access to the data directory.
I don't know for sure what's going on, but I think the real problem is
the server/system setup.
https://dev.mysql.com/doc/refman/8.0/en/data-directory.html
Mike
More information about the mythtv-users
mailing list