• Daniel Black's avatar
    MDEV-14578: mysql_install_db install unix_socket plugin when... · 53db5edb
    Daniel Black authored
    MDEV-14578: mysql_install_db install unix_socket plugin when --auth-root-authentication-method=socket
    
    $ cmake -DPLUGIN_AUTH_SOCKET=STATIC ../mariadb-server-10.2/
    
    $ scripts/mysql_install_db --datadir=/tmp/mysqldatadir-auth-static --auth-root-socket-user=dan --auth-root-authentication-method=socket --builddir=.  --srcdir=../mariadb-server-10.2
    Installing MariaDB/MySQL system tables in '/tmp/mysqldatadir-auth-static' ...
    OK
    
    $ client/mysql -S /tmp/mysql.sock -e 'show create user dan@localhost'
    +----------------------------------------------------------+
    | CREATE USER for dan@localhost                            |
    +----------------------------------------------------------+
    | CREATE USER 'dan'@'localhost' IDENTIFIED VIA unix_socket |
    +----------------------------------------------------------+
    
    $ cmake -DPLUGIN_AUTH_SOCKET=NO ../mariadb-server-10.2/
    $ scripts/mysql_install_db --datadir=/tmp/mysqldatadir-auth-none --auth-root-socket-user=dan --auth-root-authentication-method=socket --builddir=.  --srcdir=../mariadb-server-10.2
    Installing MariaDB/MySQL system tables in '/tmp/mysqldatadir-auth-none' ...
    ERROR: 1126  Can't open shared library '.../plugin/auth_socket/auth_socket.so' (errno: 2, cannot open shared object file: No such file or directory)
    2018-05-01 11:38:56 0 [ERROR] Aborting
    
    $ cmake -DPLUGIN_AUTH_SOCKET=DYNAMIC ../mariadb-server-10.2/
    $ scripts/mysql_install_db --datadir=/tmp/mysqldatadir-auth-dyn --auth-root-socket-user=dan --auth-root-authentication-method=socket --builddir=.  --srcdir=../mariadb-server-10.2
    Installing MariaDB/MySQL system tables in '/tmp/mysqldatadir-auth-dyn' ...
    OK
    $ ./sql/mysqld  --datadir=/tmp/mysqldatadir-auth-dyn  --lc-messages-dir=${PWD}/sql/share --plugin-dir=./plugin/auth_socket/
    $ client/mysql -S /tmp/mysql.sock -e 'show create user dan@localhost'
    +----------------------------------------------------------+
    | CREATE USER for dan@localhost                            |
    +----------------------------------------------------------+
    | CREATE USER 'dan'@'localhost' IDENTIFIED VIA unix_socket |
    +----------------------------------------------------------+
    
    $ sudo make install
    $ sudo chmod a+rwx /usr/local/mysql/data
    $ cd /usr/local/mysql/
    $ scripts/mysql_install_db  --auth-root-socket-user=dan --auth-root-authentication-method=socket
    Installing MariaDB/MySQL system tables in './data' ...
    OK
    ..
    $ bin/mysqld_safe
    $ client/mysql -S /tmp/mysql.sock -e 'show create user dan@localhost'
    +----------------------------------------------------------+
    | CREATE USER for dan@localhost                            |
    +----------------------------------------------------------+
    | CREATE USER 'dan'@'localhost' IDENTIFIED VIA unix_socket |
    +----------------------------------------------------------+
    
    Merges #767
    53db5edb
mysql_install_db.sh 17.8 KB