The following restrictions apply to use of MySQL on the Windows platform:以下限制适用于在Windows平台上使用MySQL:
Process memory进程内存
On Windows 32-bit platforms, it is not possible by default to use more than 2GB of RAM within a single process, including MySQL. 在Windows 32位平台上,默认情况下,不可能在单个进程(包括MySQL)中使用超过2GB的RAM。This is because the physical address limit on Windows 32-bit is 4GB and the default setting within Windows is to split the virtual address space between kernel (2GB) and user/applications (2GB).这是因为Windows 32位上的物理地址限制为4GB,而Windows中的默认设置是在内核(2GB)和用户/应用程序(2GB)之间划分虚拟地址空间。
Some versions of Windows have a boot time setting to enable larger applications by reducing the kernel application. Alternatively, to use more than 2GB, use a 64-bit version of Windows.某些版本的Windows具有启动时间设置,通过减少内核应用程序来启用较大的应用程序。或者,要使用2GB以上,请使用64位版本的Windows。
File system aliases文件系统别名
When using 使用MyISAM
tables, you cannot use aliases within Windows link to the data files on another volume and then link back to the main MySQL datadir
location.MyISAM
表时,不能在Windows中使用别名。链接到另一个卷上的数据文件,然后再链接回MySQL的主datadir
位置。
This facility is often used to move the data and index files to a RAID or other fast solution.此功能通常用于将数据和索引文件移动到RAID或其他快速解决方案。
Limited number of ports端口数量有限
Windows systems have about 4,000 ports available for client connections, and after a connection on a port closes, it takes two to four minutes before the port can be reused. Windows系统有大约4000个端口可用于客户端连接,在端口上的连接关闭后,需要两到四分钟才能重新使用该端口。In situations where clients connect to and disconnect from the server at a high rate, it is possible for all available ports to be used up before closed ports become available again. 在客户端高速连接到服务器和从服务器断开连接的情况下,在关闭的端口再次可用之前,所有可用端口都可能用完。If this happens, the MySQL server appears to be unresponsive even though it is running. Ports may be used by other applications running on the machine as well, in which case the number of ports available to MySQL is lower.如果发生这种情况,即使MySQL服务器正在运行,它似乎也没有响应。端口也可能被机器上运行的其他应用程序使用,在这种情况下,MySQL可用的端口数量较少。
For more information about this problem, see https://support.microsoft.com/kb/196271.有关此问题的详细信息,请参阅https://support.microsoft.com/kb/196271。
DATA DIRECTORY
and 和INDEX DIRECTORY
The DATA DIRECTORY
clause of the CREATE TABLE
statement is supported on Windows for InnoDB
tables only, as described in Section 15.6.1.2, “Creating Tables Externally”. CREATE TABLE
语句的DATA DIRECTORY
子句在Windows上仅支持InnoDB
表,如第15.6.1.2节,“从外部创建表”所述。For 对于MyISAM
and other storage engines, the DATA DIRECTORY
and INDEX DIRECTORY
clauses for CREATE TABLE
are ignored on Windows and any other platforms with a nonfunctional realpath()
call.MyISAM
和其他存储引擎,在Windows和任何其他具有非功能realpath()
调用的平台上,CREATE TABLE
的DATA DIRECTORY
和INDEX DIRECTORY
子句将被忽略。
You cannot drop a database that is in use by another session.不能删除另一个会话正在使用的数据库。
Case-insensitive names不区分大小写的名称
File names are not case-sensitive on Windows, so MySQL database and table names are also not case-sensitive on Windows. 在Windows上,文件名不区分大小写,因此MySQL数据库和表名在Windows上也不区分大小字母。The only restriction is that database and table names must be specified using the same case throughout a given statement. See Section 9.2.3, “Identifier Case Sensitivity”.唯一的限制是,在给定的语句中,必须使用相同的大小写指定数据库和表名。参见第9.2.3节,“标识符大小写敏感性”。
Directory and file names目录和文件名
On Windows, MySQL Server supports only directory and file names that are compatible with the current ANSI code pages. For example, the following Japanese directory name does not work in the Western locale (code page 1252):在Windows上,MySQL Server仅支持与当前ANSI代码页兼容的目录和文件名。例如,以下日语目录名在西方语言环境中不起作用(代码页1252):
datadir="C:/私たちのプロジェクトのデータ"
The same limitation applies to directory and file names referred to in SQL statements, such as the data file path name in 同样的限制也适用于SQL语句中引用的目录和文件名,例如LOAD DATA
.LOAD DATA
中的数据文件路径名。
The \
path name separator character\
路径名称分隔符
Path name components in Windows are separated by the Windows中的路径名组件由\
character, which is also the escape character in MySQL. \
字符分隔,\字符也是MySQL中的转义符。If you are using 如果您正在使用LOAD DATA
or SELECT ... INTO OUTFILE
, use Unix-style file names with /
characters:LOAD DATA
或SELECT ... INTO OUTFILE
,使用带有/字符的Unix样式文件名:
mysql>LOAD DATA INFILE 'C:/tmp/skr.txt' INTO TABLE skr;
mysql>SELECT * INTO OUTFILE 'C:/tmp/skr.txt' FROM skr;
Alternatively, you must double the 或者,您必须将\
character:\
字符加倍:
mysql>LOAD DATA INFILE 'C:\\tmp\\skr.txt' INTO TABLE skr;
mysql>SELECT * INTO OUTFILE 'C:\\tmp\\skr.txt' FROM skr;
Problems with pipes管道问题
Pipes do not work reliably from the Windows command-line prompt. If the pipe includes the character 管道在Windows命令行提示符下无法可靠工作。如果管道包含字符^Z/CHAR(24),则Windows认为它遇到了文件结尾,并中止程序。^Z
/ CHAR(24)
, Windows thinks that it has encountered end-of-file and aborts the program.
This is mainly a problem when you try to apply a binary log as follows:当您尝试按如下方式应用二进制日志时,这主要是一个问题:
C:\> mysqlbinlog binary_log_file
| mysql --user=root
If you have a problem applying the log and suspect that it is because of a 如果您在应用日志时遇到问题,并怀疑是因为^Z
/ CHAR(24)
character, you can use the following workaround:^Z
/CHAR(24)
字符,可以使用以下解决方法:
C:\>mysqlbinlog
C:\>binary_log_file
--result-file=/tmp/bin.sqlmysql --user=root --execute "source /tmp/bin.sql"
The latter command also can be used to reliably read any SQL file that may contain binary data.后一个命令也可以用于可靠地读取任何可能包含二进制数据的SQL文件。