Hi,
Whenever I try to create a new virtual machine, I always get an error:
MySQL database failed! : mysql::execute_sql_logged failed : SQL alter user 'username'@'localhost' identified by 'password' failed : You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'user 'username'@'localhost' identified by 'password'' at line 1 at /usr/share/webmin/web-lib-funcs.pl line 1496.
I am using: mysqld Ver 10.1.44-MariaDB-0ubuntu0.18.04.1 for debian-linux-gnu on x86_64 (Ubuntu 18.04) and mariadb Ver 15.1 Distrib 10.1.44-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
I had this issue in my test environment and I thought I might have done something wrong, so wiped off the server and rebuilt it from the scratch and it worked fine.
But today when we tried creating a new virtual server we faced the same issue and so we started digging deeper and found a lot of people on the community are also having this issue from last 1-2 years, for example here is just one of the many links; (https://www.virtualmin.com/node/64694). I nmy opinion this should have been a major issue and so I am surprised this issue is still open unless there has been yet another update from MariaDB or MySQL.
I have found lots of so calle solution/workaround - but I am not sure how to implement i... for example have a look at this which @Jamie posted: https://github.com/virtualmin/virtualmin-gpl/commit/a45a2b839bc3ffc80f25...
So I finally downgraded from 6.09 to 6.05 - obviously I don't want to be so far behind, but as this is a production box with customer data, I cannot take chance.
So please help me out with a permanent and/or long term fix.
Many Thanks, Rav
Comments
Submitted by raviktiwari on Tue, 05/12/2020 - 20:56 Comment #1
Submitted by Martinqws on Wed, 05/13/2020 - 14:58 Pro Licensee Comment #2
I have the same problem. Already posted on the forum but no response. For me a reason to switch to the pro version in the hope to get some support. See: https://forum.virtualmin.com/t/mysql-database-failed-sql-alter-user-fail...
Fixed.
https://github.com/webmin/webmin/commit/ba0c38aeed697eafdd711b2445e9c89a... https://github.com/virtualmin/virtualmin-gpl/commit/c2245246f5719fad96a6...
Submitted by raviktiwari on Thu, 05/14/2020 - 10:29 Comment #4
Hi
Thanks for sharing the link, but I myself posted this link in my question itself - after a lot of research online.
But this is not helpful, as it does not say, which file to edit, what is the path of that file and if it is an edit or additional piece of code that needs to be written or copy-paste in that particular file.
A detailed help will be really appreciated.
Many Thanks, Rav
All files are under:
/usr/share/webmin
Opening links you will see the sub-path and the file name:
mysql/mysql-lib.pl - replace with mysql-lib.pl
virtual-server/feature-mysql.pl - replace with feature-mysql.pl
Submitted by Université Aix-... on Fri, 05/15/2020 - 02:32 Pro Licensee Comment #6
Thank you.
Will you include this patch in next versions of virtualmin ?
Regards
Submitted by Université Aix-... on Fri, 05/15/2020 - 02:33 Pro Licensee Comment #7
Thank you.
Will you include this patch in next versions of virtualmin ?
Regards
Yes.