I have been using mariadb for a while. The common commands and syntaxes have not changed. A little more complex, such as replication, does not find any difference in root mysql.
However, there are actually some differences today. mariadb's permission management root mysql is different. mysql can create an account with the same root account permissions, but mariadb won't work, and the writing is also different.
1. mariadb grant authorization error
MariaDB [(none)]> grant all privileges on *. * TO tank @ '2017. 192.% 'identified by 'test ';
ERROR 1045 (28000): Access denied for user 'root' @ 'localhost' (using password: NO)
The same command is run in mysql.
At first, I thought that the root account and password of mariadb were incorrect. After checking, there was no problem.
2. mariadb and mysql have different root permissions.
Check that the permissions of the root account are different from those of mysql.
MariaDB [(none)]> show grants \ G;
* *************************** 1. row ***************************
Grants for root @ localhost: grant select, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, show databases, SUPER, create temporary tables, lock tables, EXECUTE, replication slave, replication client, create view, show view, create routine, alter routine, create user, EVENT, trigger on *. * TO 'root' @ 'localhost' WITH GRANT OPTION
1 row in set (0.00 sec)
ERROR: No query specified
Mysql> show grants;
+ --------------------------------------------------------------------- +
| Grants for root @ localhost |
+ --------------------------------------------------------------------- +
| Grant all privileges on *. * TO 'root' @ 'localhost' with grant option |
+ --------------------------------------------------------------------- +
1 row in set (0.00 sec)
3. mariadb and mysql grant have different syntaxes.
Specific lecture to, please refer to: https://mariadb.com/kb/en/mariadb/grant/
MariaDB [(none)]> grant all on test. * TO tank @ '2017. 192.% 'identified by 'test ';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> grant select on *. * TO tank @ '2017. 192.% 'identified by 'test ';
Query OK, 0 rows affected (0.00 sec)
Run the first command to grant all permissions of the test database to tank.
The second command gives the select permission for all databases and tables to tank.
Note: all cannot be used with *. *. Otherwise, an error is returned.