如何在 Windows 上引导 MySQL? [英] How to bootstrap MySQL on Windows?

查看:31
本文介绍了如何在 Windows 上引导 MySQL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Windows 7 x64 上引导 mysqld.我该怎么做?

I am trying to bootstrap mysqld on Windows 7 x64. How should I do this?

(通过引导程序",我的意思是创建初始数据目录和系统表.我想我会在 Unix 上使用 mysql_install_db,但文档说这不适用于 Windows?)

(By 'bootstrap', I mean create the initial data directory and system tables. I think I would use mysql_install_db for Unix, but the docs says this doesn't work for Windows?)

到目前为止我做了什么:

What I have done so far:

  • 我有一个可以运行的 MySQL 安装.
  • 我正在尝试使用不同的 .ini 文件创建一个新的 mysqld 实例.
  • 我想从头开始"创建 mysqld 的新实例及其相关文件(即,我不想从现有安装中复制任何文件.

我正在运行的确切命令是:

The exact command I am running is:

D:\MySQL5.6\MySQL Server 5.6\bin\mysqld.exe --defaults-file=my-test-server-C.ini --bootstrap --lc-messages-dir=D:\MySQL5.6\MySQL Server 5.6\share\ --character-sets-dir=D:\MySQL5.6\MySQL Server 5.6\share\charsets\

文件my-test-server-C.ini"确实存在并且似乎是有效的.如果有帮助,我可以提供任何详细信息.

The file 'my-test-server-C.ini' does exist and appears to be valid. I can provide any details from this if it would help.

执行命令后,stderr上没有输出.

After executing the command, there is no output on stderr.

我确实在test-server-C.err"中看到了一个关于引导程序文件错误"的错误.我的理解是 --bootstrap 选项应该创建所有必要的表?我不认为这是权限问题.

I do see an error in 'test-server-C.err' about a "Bootstrap file error". My understanding is that the --bootstrap option should create all the necessary tables? I don't think this is a permissions problem.

'test-server-C.err' 文件包含以下内容:

The 'test-server-C.err' file contains the following:

2014-06-25 10:52:19 9540 [Note] Plugin 'FEDERATED' is disabled.
2014-06-25 10:52:19 9540 [Warning] option 'innodb-autoextend-increment': unsigned value 67108864 adjusted to 1000
2014-06-25 10:52:19 45c InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
2014-06-25 10:52:19 9540 [Note] InnoDB: The InnoDB memory heap is disabled
2014-06-25 10:52:19 9540 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2014-06-25 10:52:19 9540 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-06-25 10:52:19 9540 [Note] InnoDB: Not using CPU crc32 instructions
2014-06-25 10:52:19 9540 [Note] InnoDB: Initializing buffer pool, size = 703.0M
2014-06-25 10:52:19 9540 [Note] InnoDB: Completed initialization of buffer pool
2014-06-25 10:52:19 9540 [Note] InnoDB: The first specified data file .\ibdata1 did not exist: a new database to be created!
2014-06-25 10:52:19 9540 [Note] InnoDB: Setting file .\ibdata1 size to 12 MB
2014-06-25 10:52:19 9540 [Note] InnoDB: Database physically writes the file full: wait...
2014-06-25 10:52:19 9540 [Note] InnoDB: Setting log file .\ib_logfile101 size to 48 MB
2014-06-25 10:52:19 9540 [Note] InnoDB: Setting log file .\ib_logfile1 size to 48 MB
2014-06-25 10:52:20 9540 [Note] InnoDB: Renaming log file .\ib_logfile101 to .\ib_logfile0
2014-06-25 10:52:20 9540 [Warning] InnoDB: New log files created, LSN=45781
2014-06-25 10:52:20 9540 [Note] InnoDB: Doublewrite buffer not found: creating new
2014-06-25 10:52:20 9540 [Note] InnoDB: Doublewrite buffer created
2014-06-25 10:52:20 9540 [Note] InnoDB: 128 rollback segment(s) are active.
2014-06-25 10:52:20 9540 [Warning] InnoDB: Creating foreign key constraint system tables.
2014-06-25 10:52:20 9540 [Note] InnoDB: Foreign key constraint system tables created
2014-06-25 10:52:20 9540 [Note] InnoDB: Creating tablespace and datafile system tables.
2014-06-25 10:52:20 9540 [Note] InnoDB: Tablespace and datafile system tables created.
2014-06-25 10:52:20 9540 [Note] InnoDB: Waiting for purge to start
2014-06-25 10:52:20 9540 [Note] InnoDB: 5.6.12 started; log sequence number 0
2014-06-25 10:52:20 9540 [Note] RSA private key file not found: D:\Projects\mysqlab\data-test-server-C\\private_key.pem. Some authentication plugins will not work.
2014-06-25 10:52:20 9540 [Note] RSA public key file not found: D:\Projects\mysqlab\data-test-server-C\\public_key.pem. Some authentication plugins will not work.
ERROR: 1105  Bootstrap file error, return code (32). Nearest query: ''
2014-06-25 10:52:20 9540 [ERROR] Aborting

2014-06-25 10:52:20 9540 [Note] Binlog end
2014-06-25 10:52:20 9540 [Note] InnoDB: FTS optimize thread exiting.
2014-06-25 10:52:20 9540 [Note] InnoDB: Starting shutdown...
2014-06-25 10:52:21 9540 [Note] InnoDB: Shutdown completed; log sequence number 1600607
2014-06-25 10:52:21 9540 [Note] D:\MySQL5.6\MySQL Server 5.6\bin\mysqld.exe: Shutdown complete

更新 1

我也尝试过不使用带有以下命令的默认文件:

UPDATE 1

I have also tried not using a defaults file with the following command:

"D:\MySQL5.6\MySQL Server 5.6\bin\mysqld.exe" --no-defaults --bootstrap --basedir=D:\Projects\mysqlab --datadir=D:\Projects\mysqlab\data-test-server-C --lc-messages-dir="D:\MySQL5.6\MySQL Server 5.6\share" --character-sets-dir="D:\MySQL5.6\MySQL Server 5.6\share\charsets"

这也会导致错误:1105 Bootstrap 文件错误,返回代码 (32).最近的查询:''

This also results in ERROR: 1105 Bootstrap file error, return code (32). Nearest query: ''

我已将 MySQL 源文件 msyql-server-5.6.17\mysql-test 中的 private_key.pem 和 public_key.pem 复制到我的数据目录中.这消除了有关缺少 RSA 密钥的警告.但是,同样的ERROR 115仍然存在.

I have copied the private_key.pem and public_key.pem from the MySQL source msyql-server-5.6.17\mysql-test to my data directory. This gets rid of the warnings about the missing RSA keys. However, the same ERROR 115 still exists.

推荐答案

似乎对于 Windows,推荐的方法是简单地从 .zip 存档中复制现有数据目录

It appears that for Windows, the recommended way to do this is to simply copy the existing data directory from the .zip archive

http://dev.mysql.com/doc/refman/5.7/en/multiple-data-directories.html

http://dev.mysql.com/downloads/mysql/

这篇关于如何在 Windows 上引导 MySQL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆