When running mariadb-setpermission it fails to connect to MariaDB. On line 89 (in MariaDB 10.5.4) it tries to connect using port/host and mariadb_socket, and all three of these cannot be used together. You get the error:
Can't make a connection to the mysql server.
The error: Connection error: host or port cannot be specified together with mariadb_socket at /usr/bin/mariadb-setpermission line 89, <STDIN> line 1.
Anel Husakovic
added a comment - - edited Hi sanja can you please review 9e5202f6f96 ?
$ ./scripts/mariadb-setpermission --socket=/tmp/mysql.sock
Options read from mycnf:
user=anel
password=
Password for user anel to connect to MariaDB:
######################################################################
## Welcome to the permission setter 1.4 for MariaDB.
## made by Luuk de Boer
######################################################################
What would you like to do:
1. Set password for an existing user.
2. Create a database + user privilege for that database
and host combination (user can only do SELECT)
3. Create/append user privilege for an existing database
and host combination (user can only do SELECT)
4. Create/append broader user privileges for an existing
database and host combination
(user can do SELECT,INSERT,UPDATE,DELETE)
5. Create/append quite extended user privileges for an
existing database and host combination (user can do
SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,
LOCK TABLES,CREATE TEMPORARY TABLES)
6. Create/append full privileges for an existing database
and host combination (user has FULL privilege)
7. Remove all privileges for for an existing database and
host combination.
(user will have all permission fields set to N)
0. exit this program
Make your choice [1,2,3,4,5,6,7,0]:
or
$ ./scripts/mariadb-setpermission --host=anel --user=t --password=ttt
Options read from mycnf:
######################################################################
## Welcome to the permission setter 1.4 for MariaDB.
## made by Luuk de Boer
######################################################################
What would you like to do:
1. Set password for an existing user.
2. Create a database + user privilege for that database
and host combination (user can only do SELECT)
3. Create/append user privilege for an existing database
and host combination (user can only do SELECT)
4. Create/append broader user privileges for an existing
database and host combination
(user can do SELECT,INSERT,UPDATE,DELETE)
5. Create/append quite extended user privileges for an
existing database and host combination (user can do
SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,
LOCK TABLES,CREATE TEMPORARY TABLES)
6. Create/append full privileges for an existing database
and host combination (user has FULL privilege)
7. Remove all privileges for for an existing database and
host combination.
(user will have all permission fields set to N)
0. exit this program
Make your choice [1,2,3,4,5,6,7,0]: 1
The patch is also related to MDEV-23016 .
Also there was a question on KB https://mariadb.com/kb/en/mysql_setpermission-depracated/
I agree that we should use chmod to this file, right?
It seems to be a problem specific to DBD::MariaDB. In previous versions, which use DBD::mysql, it works fine.