← Back to team overview

maria-developers team mailing list archive

Re: passwordless mariadb root login with auht_socket in Debian

 

The procedure is used here as it only executes "INSTALL PLUGIN unix_socket SONAME 'auth_socket';" if the plugin is not actually loaded (would output an error if it was the case).

Another small issue of the actual approach is that it requires another mysqld execution just for this task which takes some times and is especially problematic when doing a package upgrade.

Le 24/02/2015 10:06, Otto Kekäläinen a écrit :
Thanks for your help!

How should this then be re-written correctly?

SET sql_log_bin=0; USE mysql; DELIMITER //; CREATE PROCEDURE
debian_plugin_install(IN plugin_name CHAR(50), IN soname CHAR(50))
BEGIN DECLARE CONTINUE HANDLER FOR NOT FOUND  EXECUTE
inst_plug; set @plugin_name=plugin_name; set @soname=soname ;set
@install_plugin=CONCAT(\"INSTALL PLUGIN \",@plugin_name,\" SONAME '\",
@soname, \"'\");PREPARE inst_plug FROM @install_plugin ;
select PLUGIN_NAME INTO @a from  information_schema.plugins where
PLUGIN_NAME=@plugin_name AND PLUGIN_STATUS='ACTIVE' AND
PLUGIN_TYPE='AUTHENTICATION' AND PLUGIN_LIBRARY LIKE
concat(@soname,'%'
); DEALLOCATE PREPARE inst_plug; END// CALL
debian_plugin_install('unix_socket', 'auth_socket') // DROP PROCEDURE
debian_plugin_install//

https://github.com/ottok/mariadb-10.0/blob/master/debian/mariadb-server-10.0.postinst#L179

Pull requests appreciated :)


References