Bug #81082 MySQL X console on Windows??
Submitted: 14 Apr 2016 13:37 Modified: 19 May 2016 22:53
Reporter: Peter Laursen (Basic Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S2 (Serious)
Version:5.7.12 OS:Windows
Assigned to: CPU Architecture:Any

[14 Apr 2016 13:37] Peter Laursen
Description:
This docs page http://dev.mysql.com/doc/refman/5.7/en/mysql-shell-tutorial-python-shell.html does not list any specifics for Windows.

There is no 'mysqlsh' executable. However there is a 'mysqlxtest' not seen on previous versions. Looks to me like an experimental/development version of the X console (correct me if I am wrong). But it does not work as per docs. 

How to repeat:
C:\Program Files\MySQL\MySQL Server 5.7\bin>dir
 Volume in drive C is Win10
 Volume Serial Number is 0805-A57A

 Directory of C:\Program Files\MySQL\MySQL Server 5.7\bin

12-04-2016  16:32    <DIR>          .
12-04-2016  16:32    <DIR>          ..
28-03-2016  21:57         5.542.912 innochecksum.exe
07-03-2016  00:36         1.839.104 libmecab.dll
28-03-2016  21:50           356.864 lz4_decompress.exe
28-03-2016  21:54         5.061.632 myisamchk.exe
28-03-2016  21:54         4.834.304 myisamlog.exe
28-03-2016  21:54         4.964.352 myisampack.exe
28-03-2016  21:54         4.930.560 myisam_ftdump.exe
28-03-2016  21:54         5.443.584 mysql.exe
28-03-2016  21:55         5.328.384 mysqladmin.exe
28-03-2016  21:55         5.625.344 mysqlbinlog.exe
28-03-2016  21:55         5.355.520 mysqlcheck.exe
28-03-2016  22:19        39.695.360 mysqld.exe
28-03-2016  21:55         5.393.920 mysqldump.exe
28-03-2016  21:20             7.635 mysqldumpslow.pl
28-03-2016  21:20            27.732 mysqld_multi.pl
28-03-2016  21:56         5.314.048 mysqlimport.exe
28-03-2016  22:16         6.390.784 mysqlpump.exe
28-03-2016  21:56         5.312.000 mysqlshow.exe
28-03-2016  21:56         5.341.696 mysqlslap.exe
28-03-2016  22:15         8.276.480 mysqlxtest.exe
28-03-2016  21:20             7.267 mysql_config.pl
28-03-2016  21:55         5.053.952 mysql_config_editor.exe
28-03-2016  22:21        25.269.760 mysql_embedded.exe
28-03-2016  21:55         4.605.952 mysql_plugin.exe
28-03-2016  21:55         5.310.464 mysql_secure_installation.exe
28-03-2016  21:51         5.064.192 mysql_ssl_rsa_setup.exe
28-03-2016  21:51         4.478.976 mysql_tzinfo_to_sql.exe
28-03-2016  21:57         6.487.040 mysql_upgrade.exe
28-03-2016  21:51         4.587.008 my_print_defaults.exe
28-03-2016  21:56         4.753.408 perror.exe
28-03-2016  21:51         4.585.472 resolveip.exe
28-03-2016  21:51           308.736 zlib_decompress.exe
              32 File(s)    195.554.442 bytes
               2 Dir(s)  38.312.488.960 bytes free

C:\Program Files\MySQL\MySQL Server 5.7\bin>mysqlxtest.exe -uroot pltest
mysqlxtest.exe: unknown option pltest

C:\Program Files\MySQL\MySQL Server 5.7\bin>mysqlxtest -u root --py pltest
mysqlxtest: unknown option --py

C:\Program Files\MySQL\MySQL Server 5.7\bin>

('pltest' is an existing database on the server).

Suggested fix:
* document Windows specifcs (if any).
* rename the file 
* make it work as per documentation
[14 Apr 2016 15:11] MySQL Verification Team
the mysql shell is a separate download, available here:
http://dev.mysql.com/downloads/shell/
[14 Apr 2016 15:12] Peter Laursen
OK.. but what is the 'mysqlxtest.exe' then?
[14 Apr 2016 15:13] MySQL Verification Team
I do see a place for windows specific improvement in the docs here:
http://dev.mysql.com/doc/refman/5.7/en/document-store-setting-up.html

they talk about the serverside plugin but not mysql shell client on windows..
[14 Apr 2016 15:14] Peter Laursen
.. and is it planned to have it offered by the MySQL Installer for Windows?
[14 Apr 2016 15:17] Peter Laursen
"but not mysql shell client on windows".

Actually it should also be clarifed if it can be run in "Windows Powershell" or not. I could imagine some oddities happening here (with loops, conditions etc.) in some cases.
[14 Apr 2016 15:31] Peter Laursen
and what is this:

.. and what is this:

C:\Program Files\MySQL\MySQL Shell 1.0\bin>mysqlsh -uroot pltest --port=3310
Creating an X Session to root@localhost:3310/pltest
Enter password: ********
MySQL Error (2027): Unknown message received from server 10

.. and 

C:\Program Files\MySQL\MySQL Shell 1.0\bin>mysqlsh -uroot pltest
Creating an X Session to root@localhost:33060/pltest
Enter password: ********
MySQL Error (2002): Der kunne ikke oprettes forbindelse, fordi destinationscomputeren aktivt nĀµgtede det connecting to localhost:33060

(now - this as not supposed to work as the server on port 3306 is a MariaDB 10.1  server. but why doesit print the prot as "33060" and not "3306" in the error message.

I still hve to ask if mysqlsh works on Windows at all.
[14 Apr 2016 16:00] MySQL Verification Team
it does work on windows.  the port is 33060 by default.
check if server has the mysqlx plugin loaded by running "show plugins;"

...
| ngram                      | ACTIVE   | FTPARSER           | null       | GPL     |
| mysqlx                     | ACTIVE   | DAEMON             | mysqlx.dll | GPL     |
+----------------------------+----------+--------------------+------------+---------+

In mysql error log it also says a few lines:

[Note] Plugin mysqlx reported: 'X plugin tcp connection enable at port 33060.'
[Note] Plugin mysqlx reported: 'Scheduler "work" started.'
[Note] Plugin mysqlx reported: 'X plugin initialization successes'

Then you should be able to login:

E:\mysql-shell-1.0.3-winx64\bin>mysqlsh.exe -uroot --classic
Creating a Classic Session to root@localhost:3306
Enter password:
No default schema selected.

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>
[19 May 2016 22:53] Christine Cole
Posted by developer:
 
MySQL Shell is downloaded separately from MySQL 5.7.12 --
The original documentation now includes download/installation instructions for MySQL Shell on Windows.

http://dev.mysql.com/doc/refman/5.7/en/installing-mysql-shell-windows-quick.html