Bug #81257 X-Plugin installed with plugin-load does not accept connections
Submitted: 1 May 2016 10:31 Modified: 4 Jun 2016 8:59
Reporter: Giuseppe Maxia (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Document Store: X Plugin Severity:S1 (Critical)
Version:5.7.12 OS:Any
Assigned to: CPU Architecture:Any
Tags: xplugin

[1 May 2016 10:31] Giuseppe Maxia
Description:
First, I install the plugin using plugin-load
(note: the result is the same if I use "plugin-load=mysqlx:mysqlx.so" with colon instead of '=')

$ make_sandbox 5.7.12 -- -c plugin-load=mysqlx=mysqlx.so --no_show
    The MySQL Sandbox,  version 3.1.05
    (C) 2006-2016 Giuseppe Maxia
loading grants
.. sandbox server started
Your sandbox server was installed in $HOME/sandboxes/msb_5_7_12

Check that the plugin is loaded

$ ~/sandboxes/msb_5_7_12/use -e "show plugins" |grep mysqlx
mysqlx	ACTIVE	DAEMON	mysqlx.so	GPL

Check that the port is open

$ sudo netstat -atn  |grep LISTEN|grep 33060
tcp4       0      0  *.33060                *.*                    LISTEN

Try a connection:

$ mysqlsh -h 127.0.0.1 -umsandbox -pmsandbox test
mysqlx: [Warning] Using a password on the command line interface can be insecure.
Creating an X Session to msandbox@127.0.0.1:33060/test
MySQL Error (1045): Unable to switch context to user mysqlxsys

Remove the plugin

$ ~/sandboxes/msb_5_7_12/use -e 'uninstall plugin mysqlx'
$ ~/sandboxes/msb_5_7_12/use -e "show plugins" |grep mysqlx

Install the plugin from the client:
$ ~/sandboxes/msb_5_7_12/use -e "install plugin mysqlx soname 'mysqlx.so'"
$ ~/sandboxes/msb_5_7_12/use -e "show plugins" |grep mysqlx
mysqlx	ACTIVE	DAEMON	mysqlx.so	GPL

$ mysqlsh -h 127.0.0.1 -umsandbox -pmsandbox test
mysqlx: [Warning] Using a password on the command line interface can be insecure.
Creating an X Session to msandbox@127.0.0.1:33060/test
Default schema `test` accessible through db.

Welcome to MySQL Shell 1.0.3 Development Preview

Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type '\help', '\h' or '\?' for help.

Currently in JavaScript mode. Use \sql to switch to SQL mode and execute queries.
mysql-js> \q
Bye!

How to repeat:
Install the plugin using plugin-load instead of running an SQL command.
Try to connect, as shown above.
[4 Jun 2016 8:59] Giuseppe Maxia
I have found the reason for the issue. It's the same issue as Bug#81723.
In MySQL-Sandbox there is a cleanup command that removes unwanted users, and 'mysqlxsys' was not whitelisted.
The next version of MySQL-Sandbox will fix the problem.
[4 Jun 2016 11:59] MySQL Verification Team
Thank you Giuseppe.

Regards,
Umesh