Error Enabling MySQL Database

I am using MySQL version 10.1.37 and trying to enable the MySQL Database feature on a virtual server.

I get this error:

Creating MySQL login …
… MySQL database failed! : mysql::execute_sql_logged failed : SQL alter user ‘username’@‘localhost’ identified by ‘fswCyQ1SSoP48Xe’ 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 ‘fswCyQ1SSoP48Xe’’ at line 1 at /usr/share/webmin/web-lib-funcs.pl line 1478.

Saving server details …
… done

I initially installed webmin and add the virtualmin module. This is also on a RaspberryPi running Raspbian, but I don’t think is directly related here.

Any thoughts?

Same problem here:

Creating MySQL login .. .. MySQL database failed! : mysql::execute_sql_logged failed : SQL alter user '****'@'localhost' identified by '**9*' 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 '****'@'localhost' identified by '****'' at line 1 at /usr/share/webmin/web-lib-funcs.pl line 1478.

I have enabled MySQL for other sites on the same machine before, but that was before I updated every package yesterday.

I have the same problem!

I get this error:

Creating MySQL login …
… MySQL database failed! : mysql::execute_sql_logged failed : SQL alter user ‘apazadito’@‘localhost’ identified by ‘xxxxxxxxxxxxx’ 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 ‘apazadito’@‘localhost’ identified by ‘xxxxxxxxxxxxx’’ at line 1 at /usr/share/webmin/web-lib-funcs.pl line 1478.

Updating Webmin user …
… done

Updating Webmin user …
… done

Saving server details …
… done

Re-loading Webmin …
… done

I made fresh install of system and virtualmin… (debian 9, 2gb rab) and …

Creating MySQL login …
… MySQL database failed! : mysql::execute_sql_logged failed : SQL alter user ‘gfdn’@‘localhost’ identified by ‘test123’ 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 ‘gfdn’@‘localhost’ identified by ‘test123’’ at line 1 at /usr/share/webmin/web-lib-funcs.pl line 1476.

Same issue here, server made 7 days ago and was able to made new mysql database along with new account.

However after update of server few days ago this error came out

Creating MySQL login …
… MySQL database failed! : mysql::execute_sql_logged failed : SQL insert into user (host, user, ssl_type, ssl_cipher, x509_issuer, x509_subject) values (‘localhost’, ‘test’, ‘’, ‘’, ‘’, ‘’) failed : Field ‘authentication_string’ doesn’t have a default value at …/web-lib-funcs.pl line 1478.

So the problem is in version 6.06 that came out few days ago. As a temporary solution I did yum rollback of that upgrade

=====================================================================================================================================================
Package Arch Version Repository Size

Downgrading:
wbm-virtual-server noarch 2:6.05.gpl-1 virtualmin-universal 2.2 M

Transaction Summary

Downgrade 1 Package

and downgrade to Virtualmin 6.05

Just for the record I use latest Mariadb form mariadb repo

MySQL version 10.3.12

and it worked so far on all servers.

Thanks,
Neboysha

Please take a look into this https://www.virtualmin.com/node/59032 it seems related.

Same issue here.

Server version: 10.1.37-MariaDB-0+deb9u1 Debian 9.6

its not the same issue…

Hi!
Syntax “alter user” is only available for MariaDB 10.2.0

Documentation:
https://mariadb.com/kb/en/library/alter-user/

Temporary solution as described:
Downgrade to Virtualmin 6.05 gpl

[sudo] apt-get install webmin-virtual-server=6.05.gpl

=)

Yeah, works, thanks. I lost so much time with this bug…

Nice, 6.05 works. :slight_smile:

yes, downgrading to 6.0.5 works, the other option is to upgrade mysql.

webmin should check the mysql version or use the old sql commands.

I can confirm as well that going to 6.0.5 works. I did not uninstall 6.0.6, just installed 6.0.5.

I can confirm as well that going to 6.0.5 works.

This looks like a bug in the way password changes are handled in Virtualmin 6.06.

People seeing this problem - what MySQL version are you running, and on which Linux distribution?

Operating system: Debian Linux 9 64-bit

MySQL version: 10.1.37-MariaDB-0+deb9u1

Debian 9
MariaDb 10.1.x

Syntax “alter user” is only available for MariaDB 10.2.x

The solution: upgrade mariadb to 10.2.x
Or downgrade to virtualmin 6.05gpl:
[sudo] apt-get install webmin-virtual-server=6.05.gpl

MySQL: MySQL version 10.3.12 (Mariadb from mariadb repo installed before Virtualmin as always I’m doing in last 2 years, first install latest mariadb from repo https://downloads.mariadb.org/mariadb/repositories/ and then install Virtualmin that recognize MySQL was already installed)

OS: Centos 7 latest

You can get a quick fix for this problem by applying this patch : https://github.com/virtualmin/virtualmin-gpl/commit/a45a2b839bc3ffc80f2562d51b89c98e37ee4d2e