← Back to team overview

maria-developers team mailing list archive

Passwordless MariaDB root login with auth_socket in Debian continues..

 

Hello Daniel B. and others,

I decided to write to you via the mailing list so that we are
inclusive if somebody wants to join our effort to create a solid
passwordless (Debian/Ubuntu) packaging.

Thanks Daniel for all the pull requests you've made. Unfortunately
there are still some bugs. Now it ends with 'ERROR 1524 (HY000):
Plugin 'unix_socket' is not loaded'

I have built packages from the latest commit at my Debian packaging
repo https://github.com/ottok/mariadb-10.0/commits/master
(bac031c9796ebf08c651bc863bda97fcf2cce9c4) so that all of your pull
requests regarding this are included.

The dev repo addess is 'deb http://labs.seravo.fi/~otto/mariadb-repo/
mariadb-10.0-sid-amd64/' in case you forgot (see
https://wiki.debian.org/Teams/MySQL/MariaDB)

$ apt-get purge 'mysql-*' 'mariadb-*'; rm -rf /etc/mysql
/var/lib/mysql; apt-get clean; apt-get update
[..]

$ apt-get install mariadb-server
[..]

Fetched 12.6 MB in 1min 34s (133 kB/s)
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
Preparing to unpack .../mysql-common_5.5.42-1_all.deb ...
Unpacking mysql-common (5.5.42-1) ...
Selecting previously unselected package libmysqlclient18:amd64.
Preparing to unpack .../libmysqlclient18_5.5.42-1_amd64.deb ...
Unpacking libmysqlclient18:amd64 (5.5.42-1) ...
Selecting previously unselected package mariadb-common.
Preparing to unpack .../mariadb-common_10.0.17-1~exp2_all.deb ...
Unpacking mariadb-common (10.0.17-1~exp2) ...
Selecting previously unselected package mariadb-client-core-10.0.
Preparing to unpack .../mariadb-client-core-10.0_10.0.17-1~exp2_amd64.deb ...
Unpacking mariadb-client-core-10.0 (10.0.17-1~exp2) ...
Selecting previously unselected package mariadb-client-10.0.
Preparing to unpack .../mariadb-client-10.0_10.0.17-1~exp2_amd64.deb ...
Unpacking mariadb-client-10.0 (10.0.17-1~exp2) ...
Selecting previously unselected package mariadb-server-core-10.0.
Preparing to unpack .../mariadb-server-core-10.0_10.0.17-1~exp2_amd64.deb ...
Unpacking mariadb-server-core-10.0 (10.0.17-1~exp2) ...
Processing triggers for man-db (2.7.0.2-3) ...
Setting up mysql-common (5.5.42-1) ...
Setting up mariadb-common (10.0.17-1~exp2) ...
Notice: configure-symlinks trigger could not be called.
Please manually make /etc/mysql/my.cnf a symlink that points to mariadb.cnf.
Selecting previously unselected package mariadb-server-10.0.
Preparing to unpack .../mariadb-server-10.0_10.0.17-1~exp2_amd64.deb ...
Unpacking mariadb-server-10.0 (10.0.17-1~exp2) ...
Selecting previously unselected package libdbd-mysql-perl.
Preparing to unpack .../libdbd-mysql-perl_4.028-2+b1_amd64.deb ...
Unpacking libdbd-mysql-perl (4.028-2+b1) ...
Selecting previously unselected package mariadb-server.
Preparing to unpack .../mariadb-server_10.0.17-1~exp2_all.deb ...
Unpacking mariadb-server (10.0.17-1~exp2) ...
Processing triggers for man-db (2.7.0.2-3) ...
Setting up libmysqlclient18:amd64 (5.5.42-1) ...
Setting up mariadb-client-core-10.0 (10.0.17-1~exp2) ...
Setting up mariadb-client-10.0 (10.0.17-1~exp2) ...
Setting up mariadb-server-core-10.0 (10.0.17-1~exp2) ...
Setting up mariadb-server-10.0 (10.0.17-1~exp2) ...
+ . /usr/share/debconf/confmodule
++ '[' '!' '' ']'
++ PERL_DL_NONLAZY=1
++ export PERL_DL_NONLAZY
++ '[' '' ']'
++ exec /usr/share/debconf/frontend
/var/lib/dpkg/info/mariadb-server-10.0.postinst configure ''
+ . /usr/share/debconf/confmodule
++ '[' '!' 1 ']'
++ '[' -z '' ']'
++ exec
++ '[' '' ']'
++ exec
++ DEBCONF_REDIR=1
++ export DEBCONF_REDIR
+ '[' -n '' ']'
+ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/usr/sbin:/bin:/usr/bin
+ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/usr/sbin:/bin:/usr/bin
+ ERR_LOGGER='logger -p daemon.err -t mysqld_safe -i'
+ set -o pipefail
+ MYSQL_BOOTSTRAP='/usr/sbin/mysqld --bootstrap --user=mysql
--disable-log-bin --skip-grant-tables --default-storage-engine=myisam
--plugin-load-add=auth_socket'
+ set +e
+ invoke stop
+ '[' -x /usr/sbin/invoke-rc.d ']'
+ invoke-rc.d mysql stop
Stopping MariaDB database server: mysqld.
+ set -e
+ case "$1" in
+ mysql_statedir=/usr/share/mysql
+ mysql_datadir=/var/lib/mysql
+ mysql_logdir=/var/log/mysql
+ mysql_rundir=/var/run/mysqld
+ mysql_cfgdir=/etc/mysql
+ mysql_upgradedir=/var/lib/mysql-upgrade
+ '[' '!' -d /usr/share/mysql -a '!' -L /usr/share/mysql ']'
+ '[' '!' -d /var/lib/mysql -a '!' -L /var/lib/mysql ']'
+ '[' '!' -d /var/log/mysql -a '!' -L /var/log/mysql ']'
+ set +e
+ chown -R 0:0 /usr/share/mysql
+ chown -R mysql /var/lib/mysql
+ chown -R mysql:adm /var/log/mysql
+ chmod 2750 /var/log/mysql
+ set -e
+ db_set mariadb-server/postrm_remove_database false
+ _db_cmd 'SET mariadb-server/postrm_remove_database' false
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'SET mariadb-server/postrm_remove_database false'
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET='10 mariadb-server/postrm_remove_database doesn'\''t exist'
+ case ${_db_internal_line%%[ ]*} in
+ return 10
+ true
+ rm -f '/var/lib/mysql/debian-*.flag'
+ touch /var/lib/mysql/debian-10.0.flag
+ set +e
+ logger -p daemon.err -t mysqld_safe -i
+ bash /usr/bin/mysql_install_db --rpm --cross-bootstrap --user=mysql
--disable-log-bin
+ set -e
+ dc=/etc/mysql/debian.cnf
+ '[' '!' -e /etc/mysql/debian.cnf -o 'grep -sq
"^[^#]*user[^#=]*=[^#=]*debian-sys-maint" /etc/mysql/debian.cnf' ']'
+ '[' '!' -d /etc/mysql ']'
+ '[' -e /etc/mysql/debian.cnf ']'
+ oldconf=
+ umask 066
+ cat /dev/null
+ umask 022
+ echo '# Automatically generated for Debian scripts. DO NOT TOUCH!'
+ echo '[client]'
+ echo 'host     = localhost'
+ echo 'user     = root'
+ echo 'password = '
+ echo 'socket   = /var/run/mysqld/mysqld.sock'
+ echo '[mysql_upgrade]'
+ echo 'host     = localhost'
+ echo 'user     = root'
+ echo 'password = '
+ echo 'socket   = /var/run/mysqld/mysqld.sock'
+ echo 'basedir  = /usr'
+ chown 0:0 /etc/mysql/debian.cnf
+ chmod 0600 /etc/mysql/debian.cnf
++ /bin/echo -e 'USE mysql;\n' 'SET sql_log_bin=0;\n' 'ALTER TABLE
user CHANGE Password Password char(41) character set latin1 collate
latin1_bin DEFAULT '\'''\'' NOT NULL;'
+ password_column_fix_query='USE mysql;
 SET sql_log_bin=0;
 ALTER TABLE user CHANGE Password Password char(41) character set
latin1 collate latin1_bin DEFAULT '\'''\'' NOT NULL;'
+ echo 'USE mysql;
 SET sql_log_bin=0;
 ALTER TABLE user CHANGE Password Password char(41) character set
latin1 collate latin1_bin DEFAULT '\'''\'' NOT NULL;'
+ logger -p daemon.err -t mysqld_safe -i
+ /usr/sbin/mysqld --bootstrap --user=mysql --disable-log-bin
--skip-grant-tables --default-storage-engine=myisam
--plugin-load-add=auth_socket
++ /bin/echo -e 'SET sql_mode='\'''\'', sql_log_bin=0;\n' 'DELETE FROM
mysql.user WHERE user='\''debian-sys-maint'\'' AND
host='\''localhost'\'';'
+ replace_query='SET sql_mode='\'''\'', sql_log_bin=0;
 DELETE FROM mysql.user WHERE user='\''debian-sys-maint'\'' AND
host='\''localhost'\'';'
++ /bin/echo -e 'USE mysql;\n' 'SET sql_log_bin=0;\n' 'CREATE TABLE IF
NOT EXISTS plugin (name char(64) COLLATE utf8_bin NOT NULL DEFAULT
'\'''\'', ' '  dl char(128) COLLATE utf8_bin NOT NULL DEFAULT
'\'''\'', ' '  PRIMARY KEY (name)) ENGINE=MyISAM DEFAULT CHARSET=utf8
COLLATE=utf8_bin COMMENT='\''MySQL plugins'\'';\n' 'INSTALL PLUGIN
unix_socket SONAME '\''auth_socket'\'';\n'
+ install_plugins='USE mysql;
 SET sql_log_bin=0;
 CREATE TABLE IF NOT EXISTS plugin (name char(64) COLLATE utf8_bin NOT
NULL DEFAULT '\'''\'',    dl char(128) COLLATE utf8_bin NOT NULL
DEFAULT '\'''\'',    PRIMARY KEY (name)) ENGINE=MyISAM DEFAULT
CHARSET=utf8 COLLATE=utf8_bin COMMENT='\''MySQL plugins'\'';
 INSTALL PLUGIN unix_socket SONAME '\''auth_socket'\'';'
+ set +e
+ echo 'USE mysql;
 SET sql_log_bin=0;
 CREATE TABLE IF NOT EXISTS plugin (name char(64) COLLATE utf8_bin NOT
NULL DEFAULT '\'''\'',    dl char(128) COLLATE utf8_bin NOT NULL
DEFAULT '\'''\'',    PRIMARY KEY (name)) ENGINE=MyISAM DEFAULT
CHARSET=utf8 COLLATE=utf8_bin COMMENT='\''MySQL plugins'\'';
 INSTALL PLUGIN unix_socket SONAME '\''auth_socket'\'';'
+ logger -p daemon.err -t mysqld_safe -i
+ /usr/sbin/mysqld --bootstrap --user=mysql --disable-log-bin
--skip-grant-tables --default-storage-engine=myisam
--plugin-load-add=auth_socket
+ set -e
+ set_mysql_rootpw
++ mktemp
+ tfile=/tmp/tmp.RyQCYdtKwf
+ '[' '!' -f /tmp/tmp.RyQCYdtKwf ']'
+ cat
+ '[' '' = online ']'
+ /usr/sbin/mysqld --bootstrap --user=mysql --disable-log-bin
--skip-grant-tables --default-storage-engine=myisam
--plugin-load-add=auth_socket
+ retval=0
+ rm -f /tmp/tmp.RyQCYdtKwf
+ return 0
+ '[' -e ']'
+ rm -f
+ set +e
+ echo 'SET sql_mode='\'''\'', sql_log_bin=0;
 DELETE FROM mysql.user WHERE user='\''debian-sys-maint'\'' AND
host='\''localhost'\'';'
+ logger -p daemon.err -t mysqld_safe -i
+ /usr/sbin/mysqld --bootstrap --user=mysql --disable-log-bin
--skip-grant-tables --default-storage-engine=myisam
--plugin-load-add=auth_socket
+ set -e
+ '[' configure = configure ']'
+ test_passwordless_root_login
+ mysql --no-defaults -u root -h localhost
+ '[' '' = yes ']'
+ db_stop
+ echo STOP
+ '[' -x /etc/init.d/mysql ']'
+ update-rc.d mysql defaults 19 21
+ invoke-rc.d mysql start
Starting MariaDB database server: mysqld.
+ exit 0
ERROR 1524 (HY000): Plugin 'unix_socket' is not loaded
Setting up libdbd-mysql-perl (4.028-2+b1) ...
Setting up mariadb-server (10.0.17-1~exp2) ...
Processing triggers for libc-bin (2.19-13) ...

$  mysql -u root
ERROR 1524 (HY000): Plugin 'unix_socket' is not loaded

/var/log/mysql/error.log is pasted at http://paste.debian.net/161259/


Please figure out what is still missing and open new pull requests to fix it :)

The mariadb-10.0.17-exp1 at the moment in Debian experimental is
broken due to inclusion of an early version of this change, so I hope
we could get it completed soon so that I don't have to revert the
whole passwordless root account feature (which has been requested by
many).

- Otto


Follow ups