Note: By default ubuntu-18.04 apt-get package does not include mysqlx.so plugin file, but macOS mysql-server installation contains mysqlx.so by default.
How to enable mysqlx.so?
Run the following command in mysql> console to know whether mysqlx.so is installed or not:
mysql> SHOW PLUGINS\G
By default, 'mysqlx' will not present in the list. To enable it execute the following (for more info click here),
mysql> INSTALL PLUGIN mysqlx SONAME 'mysqlx.so';
Output: ... *************************** 45. row *************************** Name: mysqlx Status: ACTIVE Type: DAEMON Library: mysqlx.so License: GPL ...
In my case it is not listed in the output. (Now read the initial problem posted my me)
ERROR 1126 (HY000): Can't open shared library '/usr/lib/mysql/plugin/mysqlx.so' (errno: 2 /usr/lib/mysql/plugin/mysqlx.so: cannot open shared object file: No such file or directory)
My Solution is hard path: Build mysql-server-5.7 from the source (providing all the dependencies)
After the Post installation Setup for mysql-server, execute the following commands in mysql> console:
mysql> INSTALL PLUGIN mysqlx SONAME 'mysqlx.so'; mysql> SHOW PLUGINS\G
Output: ... *************************** 45. row *************************** Name: mysqlx Status: ACTIVE Type: DAEMON Library: mysqlx.so License: GPL ...
Additional info: Then installed mysql-shell and python-connector (for my case)
Shell and connector are required for X DevAPI (X Protocol) programming.