Skip to content

mysql_native_password deprecated #222

@heyted

Description

@heyted

Upon installing the mythtv-backend-master package from the Mythbuntu PPA on Ubuntu 25.10, the connection to the database fails. I confirmed this issue with v35 and v36-master.

v36.0 master.202510190002.7c781b3860~ubuntu25.10.1
mysql 8.4.6-0ubuntu3

From backend log:

E CoreContext mythdbcon.cpp:247 (OpenDatabase) [DBManager0] Unable to connect to database!
E CoreContext mythdbcon.cpp:248 (OpenDatabase) Driver error was [1/1524]:#012QMYSQL: Unable to connect#012Database error was:#012Plugin 'mysql_native_password' is not loaded

Since the mysql_native_password authentication plugin in MySQL has been deprecated, it needs to be replaced with caching_sha2_password. The following workaround applied after installing the mythtv-backend-master package allows the connection to the database:

sudo mysql
CREATE USER 'mythtv'@'localhost';
ALTER USER 'mythtv'@'localhost' IDENTIFIED WITH caching_sha2_password BY '[password from /etc/mythtv/config.xml]';
GRANT ALL PRIVILEGES ON mythconverg.* To 'mythtv'@'localhost';
exit

Searching for mysql_native_password shows line 49 in packaging/deb/debian/mythtv-database.postinst has:
QUERY="CREATE USER IF NOT EXISTS '$mythtv_username'@'%' IDENTIFIED WITH mysql_native_password;
Does the above line need to be changed as shown below?
QUERY="CREATE USER IF NOT EXISTS '$mythtv_username'@'%' IDENTIFIED WITH caching_sha2_password;
Also, does the alter user line need to be changed as shown below?
mysql -e "ALTER USER 'mythtv'@'localhost' IDENTIFIED WITH caching_sha2_password BY '$password';"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions