debian-sys-maint-roll-passwd icon indicating copy to clipboard operation
debian-sys-maint-roll-passwd copied to clipboard

MariaDB Syntax Error

Open TheoKouzelis opened this issue 7 years ago • 3 comments

Currently falling in to this error when running the script:

ERROR 1064 (42000) at line 1: 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 'root'@'localhost'

TheoKouzelis avatar Sep 19 '17 08:09 TheoKouzelis

I also seem to get a similar error on our MySQL 5.6.16 installs

ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED BY

TheoKouzelis avatar Sep 19 '17 08:09 TheoKouzelis

I think I know the issue, we are on "xenial" but using MySQL 5.6. But the outcome of this case statement means we would have to be using MySQL 5.7 for the syntax to work

  • Code: https://github.com/digitalocean/debian-sys-maint-roll-passwd/blob/master/fix.sh#L87

  • Docs: https://dev.mysql.com/doc/refman/5.7/en/default-privileges.html#idm139777195325744

TheoKouzelis avatar Sep 19 '17 09:09 TheoKouzelis

Adding xenial to case statements fixed it for me, but maybe it should be a case statement based off the MySQL version

TheoKouzelis avatar Sep 19 '17 09:09 TheoKouzelis