mysql_setpermission is a Perl script that was originally written and contributed by Luuk de Boer. It requires the DBI and DBD::mysql Perl modules to be installed. mysql_setpermission can help you add users or databases or change passwords in MariaDB.
It interactively sets permissions in the MariaDB grant tables, but does not check permissions which have already been set in MariaDB. So if you can't connect to MariaDB using the permission you just added, take a look at the permissions which have already been set in MariaDB.
The account used when you connect determines which permissions you have when attempting to modify existing permissions in the grant tables.
mysql_setpermission also reads options from the [client] and [perl] groups in the .my.cnf file in your home directory, if the file exists.
From MariaDB 10.4.6,
mariadb-setpermission is a symlink to
From MariaDB 10.5.2,
mysql_setpermission is the symlink, and
mariadb-setpermission the binary name.
The following options are available:
|Display a help message and exit.|
|Connect to the MariaDB server on the given host.|
|The password to use when connecting to the server. Note that the password value is not optional for this option, unlike for other MariaDB programs Specifying a password on the command line should be considered insecure. You can use an option file to avoid giving the password on the command line.|
|The TCP/IP port number to use for the connection.|
|For connections to localhost, the Unix socket file to use.|
|The MariaDB user name to use when connecting to the server.|