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
3) Upgrade MariaDB (Only installing new version is not enough!)
root# mysql_upgrade
4) make following patches to: /usr/libexec/webmin/virtual-server/feature-mysql.pl
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()."}')");
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()."}')");
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 !!!
Christos Tzeremes IT Expert @ nasa.gr Thessalonikh GREECE [MACEDONIA] ctzeremes[at]nasa.gr
Thank you reply.
My code is below. https://pastebin.com/2s3qfAgJ
Is it cause of MariaDB version ?
so My MariaDB is 10.2.26
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 ?
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 !!!
Christos Tzeremes IT Expert @ nasa.gr Thessalonikh GREECE [MACEDONIA] ctzeremes[at]nasa.gr
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.
What your MariaDB version ?
I was doing this on a test server using MariaDB 10.2
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
Thanks Baterka i think Digest::SHA1 was default by Perl but you have right !!!
Christos Tzeremes IT Expert @ nasa.gr Thessalonikh GREECE [MACEDONIA] ctzeremes[at]nasa.gr
don't want SHA1 anymore!
So hopes virtualmin is solving this "BUG" soon. ;)
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 ?
There are and ONE MORE SOLUTION but everything is manual in that situation ....
You must create everything in mysql or phpmyadmin ... [user, databases ... etc .. etc....]
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
Christos Tzeremes IT Expert @ nasa.gr Thessalonikh GREECE [MACEDONIA] ctzeremes[at]nasa.gr
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):
If I try to edit a virtual server to add MySql I get the following error:
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
This is frustrating, I have tried this fix over and over and cannot get it to work. I assume I am doing it correctly but as @manchego noted it is quite confusing and had to know if I am doing it correctly.
Are there any other solutions out there?
i ran this tweak and worked for me ;) https://help.directadmin.com/item.php?id=690
Alnork
Not working for me, I hope an official fix is comming soon
For all please post in every post: working not working also versions and OS.
Make it more easy for Support here. ;) Scrolling searching for is.........
Please be aware this fix working only for MariaDB v10.4 and make sure 'gcc' is installed before you install Perl SHA1 library.
root# yum install gcc