*[QUICKFIX]* for MariaDB 10.2 - 10.4.7 !!!

  1. Make backup of /usr/libexec/webmin/virtual-server/feature-mysql.pl >> cp /usr/libexec/webmin/virtual-server/feature-mysql.pl /usr/libexec/webmin/virtual-server/feature-mysql.pl_OR

  2. Install Perl SHA1 library ( Thanx Baterka !! )

root# perl -MCPAN -e shell
cpan> install Digest::SHA1

  1. Upgrade MariaDB (Only installing new version is not enough!)

root# mysql_upgrade

  1. make following patches to: /usr/libexec/webmin/virtual-server/feature-mysql.pl
  1. Comment or delete line: 2753
    [add this 2 lines]

use Digest::SHA1 qw(sha1 sha1_hex);

return (“INSERT INTO global_priv (Host, User, Priv) VALUES (’$host’, ‘$user’, '{“access”:”.time().",“plugin”:“mysql_native_password”,“authentication_string”:""."*".uc sha1_hex(sha1($plainpass))."",“password_last_changed”:".time()."}’)");

  1. Comment or delete line: 2756
    [add this 2 lines again:]

use Digest::SHA1 qw(sha1 sha1_hex);

return (“INSERT INTO global_priv (Host, User, Priv) VALUES (’$host’, ‘$user’, '{“access”:”.time().",“plugin”:“mysql_native_password”,“authentication_string”:""."*".uc sha1_hex(sha1($plainpass))."",“password_last_changed”:".time()."}’)");

  1. Comment or delete line(s): 2787&2788
    [add this:]

my $mpass=uc sha1_hex(sha1($plainpass));

	$sql = "update global_priv set Priv = '{\"access\":".time().",\"plugin\":\"mysql_native_password\",\"authentication_string\":\"*$mpass\",\"password_last_changed\":".time()."}' where user = '$user'";

-------------------- END

See the code @ https://pastebin.com/FuZ8aqfQ

Finaly restart webmin >> systemctl restart webmin
AND VOILA !!! Now EVERYTHING its GREAT !!! You can create DB and change user DB passwords !!!

PS: I will contact with Virtualmin Team to add this fix to next updates !!!

Regards
Christos Tzeremes
IT Expert @ nasa.gr
Thessalonikh GREECE [MACEDONIA]
ctzeremes[at]nasa.gr

Thanks your work.
I did try your change “feature-mysql.pl”.
but, I got below error in the page "Edit Databases"every domains, and cannot create new vertual server.

500 - Error - Perl execution failed
Undefined subroutine &virtual_server::list_dom_mysql_databases called at /usr/libexec/webmin/virtual-server/feature-mysql.pl line 2555.

in CentOS7.6.1810
MariaDB10.2.26

Check the code at https://pastebin.com/FuZ8aqfQ

Maybe you delete or comment some other lines …

The script still working with today update of MariaDB 10.4.7 !!!

This doesn’t work for me either. It would be useful if you could post the entire code for the sub get_user_creation_sql and sub execute_password_change_sql routines.

Thank you reply.

My code is below.
https://pastebin.com/2s3qfAgJ

Is it cause of MariaDB version ?

so My MariaDB is 10.2.26

What your MariaDB version ?

I was doing this on a test server using MariaDB 10.2

I updated my mariadb from 10.2.26 to 10.4.7.

but I cannot work it.

it shows below error.

500 - Error - Perl execution failed
Undefined subroutine &virtual_server::list_dom_mysql_databases called at /usr/libexec/webmin/virtual-server/feature-mysql.pl line 2555.

You did additional coding, didn’t you ?

https://pastebin.com/FuZ8aqfQ
https://pastebin.com/2s3qfAgJ

Both not working… Same error MariaDB 10.4

Could there be a difference yes no socket?

Or allready with wrong / buggy / error script tried before, so privileges / grant… ?

i did pointed out to mariadb cookbook to have workarround old way in this forum, don’t know if thos info’s and texts from mariadb could help some?
https://www.virtualmin.com/node/66717

You need to do 2 more things to get it work:

  1. Install Perl SHA1 library

    root# perl -MCPAN -e shell
    cpan> install Digest::SHA1
  2. Upgrade MariaDB (Only installing new version is not enough!)

    root# mysql_upgrade
  3. Then do change in feature-mysql.pl

don’t want SHA1 anymore!

So hopes virtualmin is solving this “BUG” soon. :wink:

Jamie is indeed working on this, we hope to be issuing a new Webmin version soon that handles newer MariaDB versions!

I did point him to this thread, he said there’s a handful of other things that need tweaked as well.

We’ll make a post as soon as this is corrected, thanks for posting an interim solution here!

-Eric

Hi andreychek

So what is the latest version of MariaDB currently supported ? 10.1 ?

Thanks Baterka i think Digest::SHA1 was default by Perl but you have right !!!

There are and ONE MORE SOLUTION but everything is manual in that situation …

  1. You must create everything in mysql or phpmyadmin … [user, databases … etc … etc…]

  2. And you must find the domain ID file in this folder /etc/webmin/virtual-server/domains/
    and must add or correct this values on file (search and change or add them) …
    *(You can find domain ID in virtualmin by selecting the domain you want and select Edit Virtual Server the domain ID is in Virtual server details under IP addresses…)

mysql_module=mysql << You must put mysql if missing

mysql=1 << This enable the database in Virtualmin panel must be 1

db_mysql=DB NAME << Change to your DB name

limit_mysql=0 << Limit of mysql databases on domain (0 for unlimited or whatever you want)

mysql_user=MYSQL USER << Change to your MySQL Database user name

mysql_pass=MYSQL USER PASS << Change to your MySQL Database user password

Best regards to all

My friend the changes you make in code is OK …
I forget to tell you to install Digest follow the instructions on post #11 from Baterka !!!

I am getting an error message when I try this quickfix.

If I try to create a new server this is what shows up in the advanced tab (the other tabs do not show):

HTTP/1.0 500 Perl execution failed Server: MiniServ/1.921 Date: Wed, 7 Aug 2019 01:36:58 GMT Content-type: text/html; Charset=iso-8859-1 Connection: close Error - Perl execution failed Undefined subroutine &virtual_server::list_remote_mysql_modules called at /usr/libexec/webmin/virtual-server/domain_form.cgi line 439.

If I try to edit a virtual server to add MySql I get the following error:

500 - Error - Perl execution failed Undefined subroutine &virtual_server::list_dom_mysql_databases called at /usr/libexec/webmin/virtual-server/feature-mysql.pl line 1419.

I should probably add that I am using CentOS 7 and MariaDB 10.3

Can someone please translate the “quick fix” into usable commands, please?
I didn’t have this problem before the latest Virtualmin update and my MariaDB version hasn’t changed (10.3)

However, I’m unable to create a new virtual server at the moment