Bug #36601 can't start 64 bit windows server with support for shared memory protocol
Submitted: 8 May 2008 17:24 Modified: 30 Jul 2008 20:51
Reporter: Erica Moss Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.58 enterprise 64 bit OS:Windows (server 2003)
Assigned to: Iggy Galarza CPU Architecture:Any
Tags: shared memory 64 bit

[8 May 2008 17:24] Erica Moss
Description:
After enabling shared-memory protocol on Server 5.0.58 enterprise 64 bit it was
not possible to connect.  Using the 32 bit package, it seems to work when the server is running as a service but not as a standalone.

How to repeat:
64 Bit package:
____________________________________
Start Server from Command Line:
C:\>mysqld-nt --standalone --shared-memory --shared-memory-base-name=MYSQL
080508  7:11:45  InnoDB: Started; log sequence number 0 664498239
080508  7:11:45 [Note] mysqld-nt: ready for connections.
Version: '5.0.58-enterprise-nt'  socket: ''  port: 3306  MySQL Enterprise Server (Commercial)

Start Client:
C:\>mysql -uroot -pxxxx --protocol=memory
ERROR 2038 (HY000): Can't open shared memory; client could not create request event (2)

Start Server as a Service with Enable-shared-memory in [mysqld] section of my.ini

Start Client:
C:>mysql -uroot -pxxxxx --protocol=memory
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 2

(this same error is received even if the --protocol switch isn't used.  The client will not be able to log on to the server service unless the service is restarted without the "enable-shared-memory" switch in my.ini)

32 Bit package:
________________
Start from Command Line:
C:\>mysqld-nt --console --standalone --shared-memory (or --enable-shared-memory)
080508 13:09:45  InnoDB: Started; log sequence number 2 1961156750
080508 13:09:45 [Note] mysqld-nt: ready for connections.
Version: '5.0.58-enterprise-nt'  socket: ''  port: 3306  MySQL Enterprise Server (Commercial)
Can't create shared memory service: Could not create file mapping.: No error

Start as a Service:
using "enable-shared-memory", or "shared memory" in the [mysqld] section of my.ini == SUCCESS

Log in using client:
C:\>mysql --protocol=memory -uroot -pmypass == SUCCESS
[30 Jun 2008 14:04] Eckhard Pruehs
Same problem with 32 bit standalone version under Windows XP and Vista using shared memory protocol in version 5.1.24
[30 Jul 2008 20:51] Iggy Galarza
I was unable to recreate the symptom using the mysql-essential-5.1.26-winx64.msi. I installed and configured an instance using all the defaults. I stopped the service and I manually added the following two lines to the defaults-file(my.ini):
shared-memory
shared-memory-base-name=MYSQL

Next I restarted the service and attempted to connect with the client. Here is the output from the command line:

$ ./mysql.exe -uroot -P3306 --protocol=memory -p
Enter password: ****
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.26-rc-community MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> status
--------------
c:\Program Files\MySQL\MySQL Server 5.1\bin\mysql.exe  Ver 14.14 Distrib 5.1.26-rc, for Win64 (unknown)

Connection id:          4
Current database:
Current user:           root@localhost
SSL:                    Not in use
Using delimiter:        ;
Server version:         5.1.26-rc-community MySQL Community Server (GPL)
Protocol version:       10
Connection:             Shared memory: MYSQL
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    latin1
Conn.  characterset:    latin1
TCP port:               3306
Uptime:                 3 min 12 sec

Threads: 1  Questions: 9  Slow queries: 0  Opens: 15  Flush tables: 1  Open tables: 8  Queries per second avg: 0.46
--------------

Next I tested a default installation/configuration of mysql-essential-5.0.67-winx64.msi with the defaults-file modification outlined above.  Here are the results:

>mysql.exe -uroot -P3306 --protocol=memory -p
Enter password: ****
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.67-community-nt MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> status
--------------
mysql.exe  Ver 14.12 Distrib 5.0.67, for Win64 (unknown)

Connection id:          1
Current database:
Current user:           root@localhost
SSL:                    Not in use
Using delimiter:        ;
Server version:         5.0.67-community-nt MySQL Community Edition (GPL)
Protocol version:       10
Connection:             Shared memory: MYSQL
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    latin1
Conn.  characterset:    latin1
TCP port:               3306
Uptime:                 55 sec

Threads: 1  Questions: 4  Slow queries: 0  Opens: 12  Flush tables: 1  Open tables: 6  Queries per second avg: 0.073
--------------

mysql> show variables like 'shared%';
+-------------------------+-------+
| Variable_name           | Value |
+-------------------------+-------+
| shared_memory           | ON    |
| shared_memory_base_name | MYSQL |
+-------------------------+-------+
2 rows in set (0.00 sec)
[11 Aug 2008 20:42] Sven Nowak
We reproduced the problem on windows vista x64, windows vista home basic x86
both not running as a windows service:

Files used:
-----------

  mysql-noinstall-5.1.26-rc-win32.zip
  mysql-noinstall-5.1.26-rc-winx64.zip

1) Contents my.ini:
-------------------

Copy of my-small.ini, added these two lines under [mysqld]:

  shared-memory
  shared-memory-base-name=MYSQL

2) Starting database server:
----------------------------

  mysqld.exe --defaults-file=..\my.ini

3) Setting "root" password:
---------------------------

  mysqladmin -u root password root

4) Connecting to database server:
---------------------------------

  mysql.exe -u root --protocol=memory -p

Result on Windows XP:
---------------------

  All commands execute properly and without error.

Result on Windows Vista x64/ Vista Home Basic x86:
--------------------------------------------------

  Executing steps 1) to 4) with non-elevated cmd.exe:

    ### CONSOLE SNIPPET START ###
    C:\Users\xyz\Desktop\mysql-noinstall-5.1.26-rc-winx64\mysql-5.1.26-rc-winx64\bin>mysql.exe -u root --protocol=memory -p
    Enter password: ****
    ERROR 2038 (HY000): Can't open shared memory; client could not create request event (2)

    C:\Users\xyz\Desktop\mysql-noinstall-5.1.26-rc-winx64\mysql-5.1.26-rc-winx64\bin>
    ### CONSOLE SNIPPET END ###

  Executing steps 2) and 4) with elevated cmd.exe:

    ### CONSOLE SNIPPET START ###
    C:\Users\xyz\Desktop\mysql-noinstall-5.1.26-rc-winx64\mysql-5.1.26-rc-winx64\bin>mysql.exe -u root --protocol=memory -p
    Enter password: ****
    ERROR 2038 (HY000): Can't open shared memory; client could not create request event (2)

    C:\Users\xyz\Desktop\mysql-noinstall-5.1.26-rc-winx64\mysql-5.1.26-rc-winx64\bin>
    ### CONSOLE SNIPPET END ###

Possibly related, suspected problem:
------------------------------------

"Global CreateFileMapping under Vista UAC":
  http://www.celceo.com/blogs/windows-insight/2007/09/global-createfilemapping-under.html
[17 Aug 2011 5:20] MySQL Verification Team
Erica, you forget to specify the shared-memory-base-name for the client. Look, this works:

----------
server:
----------
I:\mysql\5.0\5.0.60\mysql-enterprise-gpl-5.0.60sp1-winx64\bin>mysqld-nt --no-defaults --shared-memory --shared-memory-base-name=MySQL --console --skip-grant-tables --skip-name-resolve

----------
client:
----------
I:\mysql\5.0\5.0.60\mysql-enterprise-gpl-5.0.60-winx64\bin>mysql --no-defaults --protocol=memory --shared-memory-base-name=MySQL
<cut>
mysql> status
Connection:             Shared memory: MySQL
<cut>
[17 Aug 2011 5:33] MySQL Verification Team
the default shared memory base name is MYSQL and this is case sensitive.