I’m currently learning MariaDB basics and one of the problems I’ve encountered is this syntax error:
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 ‘READ ONLY = 1’ at line 1
after entering this command:
ALTER DATABASE testDB READ ONLY = 1;
Can anyone help? I don’t know what’s going on.
diedassel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
0
The READ ONLY
option was added to MySQL for the 8.0 release.
But MySQL and MariaDB are diverging. This option is not part of MariaDB and will not work there.
The syntax of MariaDB’s ALTER DATABASE
is documented to be
ALTER {DATABASE | SCHEMA} [db_name]
alter_specification ...
ALTER {DATABASE | SCHEMA} db_name
UPGRADE DATA DIRECTORY NAME
alter_specification:
[DEFAULT] CHARACTER SET [=] charset_name
| [DEFAULT] COLLATE [=] collation_name
| COMMENT [=] 'comment'
Your query doesn’t comply with the recognized syntax. You appear to be using a query designed for another database (such as MySQL).
0