2017-01-23 188 views
0

更新:解決!這是我的解決方案:Windows 10上安裝MySql問題

今天的系統通常運行在格式爲GPT的磁盤上。這是因爲Windows 10需要安裝這樣的分區。問題是MySql不能處理這種分區風格,所以它崩潰了。這裏是我的解決方法


  • 創建虛擬磁盤:manual here

  • 格式這個VHD與MBR

  • 您的新VHD安裝MySQL的自定義(不要忘記創建DB用戶 )

這應該是它! :)


我嘗試當談到啓動服務器作爲服務於我的戴爾XPS 13 9360與Windows 10安裝MySQL,該服務無法啓動。迄今爲止,這個問題廣爲人知,並且有很多嘗試來解決這個問題。不幸的是,這些工作對我來說沒有。這裏是我的嘗試:

  • 插入innodb_flush_method =正常進入的my.ini
  • 變更服務在本地帳戶註冊
  • 端口規則
  • 檢查防火牆

所以我的問題:是否有人遇到同樣的問題,並知道如何讓它運行?你能幫我真的這麼多:) 這是我的錯誤日誌:

2017-01-23T14:11:44.458654Z 0 [Warning] option 'new': boolean value 't' wasn't recognized. Set to OFF. 
2017-01-23T14:11:44.458654Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 
2017-01-23T14:11:44.458654Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled 
2017-01-23T14:11:44.459156Z 0 [Note] mysqld (mysqld 5.7.17) starting as process 5340 ... 
2017-01-23T14:11:44.468178Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 
2017-01-23T14:11:44.469212Z 0 [Note] InnoDB: Uses event mutexes 
2017-01-23T14:11:44.469713Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier 
2017-01-23T14:11:44.470716Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3 
2017-01-23T14:11:44.471217Z 0 [Note] InnoDB: Number of pools: 1 
2017-01-23T14:11:44.471719Z 0 [Note] InnoDB: Not using CPU crc32 instructions 
2017-01-23T14:11:44.474727Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M 
2017-01-23T14:11:44.481212Z 0 [Note] InnoDB: Completed initialization of buffer pool 
2017-01-23T14:11:44.546889Z 0 [ERROR] InnoDB: Header page consists of zero bytes in datafile: .\ibdata1, Space ID:0, Flags: 0. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html for how to resolve the issue. 
2017-01-23T14:11:44.548924Z 0 [ERROR] InnoDB: Corrupted page [page id: space=0, page number=0] of datafile '.\ibdata1' could not be found in the doublewrite buffer. 
2017-01-23T14:11:44.550425Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption 
2017-01-23T14:11:44.771283Z 0 [ERROR] Plugin 'InnoDB' init function returned error. 
2017-01-23T14:11:44.772134Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 
2017-01-23T14:11:44.772635Z 0 [ERROR] Failed to initialize plugins. 
2017-01-23T14:11:44.773135Z 0 [ERROR] Aborting 
2017-01-23T14:11:44.773636Z 0 [Note] Binlog end 
2017-01-23T14:11:44.774138Z 0 [Note] Shutting down plugin 'CSV' 
2017-01-23T14:11:44.774640Z 0 [Note] mysqld: Shutdown complete 

預先感謝您!


@Bill Karwin:

OK,所以刪除表空間後的結果是這樣的:

2017-01-23T15:55:22.158765Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled 
2017-01-23T15:55:22.159266Z 0 [Note] mysqld (mysqld 5.7.17) starting as process 2880 ... 
2017-01-23T15:55:22.165783Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 
2017-01-23T15:55:22.165783Z 0 [Note] InnoDB: Uses event mutexes 
2017-01-23T15:55:22.165783Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier 
2017-01-23T15:55:22.166284Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3 
2017-01-23T15:55:22.166284Z 0 [Note] InnoDB: Number of pools: 1 
2017-01-23T15:55:22.166786Z 0 [Note] InnoDB: Not using CPU crc32 instructions 
2017-01-23T15:55:22.169292Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M 
2017-01-23T15:55:22.178820Z 0 [Note] InnoDB: Completed initialization of buffer pool 
2017-01-23T15:55:22.202407Z 0 [Note] InnoDB: The first innodb_system data file 'ibdata1' did not exist. A new tablespace will be created! 
2017-01-23T15:55:22.203383Z 0 [Note] InnoDB: Setting file '.\ibdata1' size to 12 MB. Physically writing the file full; Please wait ... 
2017-01-23T15:55:22.249691Z 0 [Note] InnoDB: File '.\ibdata1' size is now 12 MB. 
2017-01-23T15:55:22.263685Z 0 [Note] InnoDB: Setting log file .\ib_logfile101 size to 48 MB 
2017-01-23T15:55:22.342287Z 0 [Note] InnoDB: Setting log file .\ib_logfile1 size to 48 MB 
2017-01-23T15:55:22.452340Z 0 [ERROR] InnoDB: Operating system error number 87 in a file operation. 
2017-01-23T15:55:22.452842Z 0 [Note] InnoDB: Some operating system error numbers are described at http://dev.mysql.com/doc/refman/5.7/en/operating-system-error-codes.html 
2017-01-23T15:55:22.453346Z 0 [ERROR] InnoDB: File .\ib_logfile101: 'aio write' returned OS error 187. Cannot continue operation 
2017-01-23T15:55:22.453346Z 0 [ERROR] InnoDB: Cannot continue operation. 

2017-01-23T15:39:39.874463Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled 
2017-01-23T15:39:39.874965Z 0 [Note] mysqld (mysqld 5.7.17) starting as process 624 ... 
2017-01-23T15:39:39.880480Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 
2017-01-23T15:39:39.880980Z 0 [Note] InnoDB: Uses event mutexes 
2017-01-23T15:39:39.881484Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier 
2017-01-23T15:39:39.882022Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3 
2017-01-23T15:39:39.882986Z 0 [Note] InnoDB: Number of pools: 1 
2017-01-23T15:39:39.882986Z 0 [Note] InnoDB: Not using CPU crc32 instructions 
2017-01-23T15:39:39.885491Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M 
2017-01-23T15:39:39.891024Z 0 [Note] InnoDB: Completed initialization of buffer pool 
2017-01-23T15:39:39.914631Z 0 [Note] InnoDB: The first innodb_system data file 'ibdata1' did not exist. A new tablespace will be created! 
2017-01-23T15:39:39.915071Z 0 [ERROR] InnoDB: redo log file '.\ib_logfile1' exists. Creating system tablespace with existing redo log files is not recommended. Please delete all redo log files before creating new system tablespace. 
2017-01-23T15:39:39.916074Z 0 [ERROR] InnoDB: InnoDB Database creation was aborted with error Generic error. You may need to delete the ibdata1 file before trying to start up again. 
2017-01-23T15:39:40.132668Z 0 [ERROR] Plugin 'InnoDB' init function returned error. 
2017-01-23T15:39:40.132668Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 
2017-01-23T15:39:40.134090Z 0 [ERROR] Failed to initialize plugins. 
2017-01-23T15:39:40.134590Z 0 [ERROR] Aborting 

2017-01-23T15:39:40.135594Z 0 [Note] Binlog end 
2017-01-23T15:39:40.136094Z 0 [Note] Shutting down plugin 'CSV' 
2017-01-23T15:39:40.136595Z 0 [Note] mysqld: Shutdown complete 

刪除logdata1和0後

新的錯誤

+0

它無法讀取InnoDB表空間。無論是你的表空間是壞的磁盤損壞,或者你自己搞亂了datadir中的文件。您可能需要刪除表空間並重新啓動MySQL服務。它應該創建一個新的空表空間。但是,您將丟失舊錶空間中的所有數據。如果您有不可替代的數據,請聯繫像twindb.com這樣的MySQL數據恢復服務。 –

+0

嘿@BillKarwin,謝謝你的幫助。你能告訴我如何刪除表空間?只是澄清:我甚至沒有使用這個安裝的MySQL,因爲它從來沒有安裝。 – Jan

+0

打開文件資源管理器到您的MySQL服務器數據目錄的文件夾。在Windows 10上,這可能是'C:\ ProgramData \ MySQL \ MySQL Server 5.7 \ data'。選擇文件「ibdata1」並刪除文件。然後在「服務」控制面板中重新啓動MySQL服務器。缺少表空間文件將導致MySQL服務器創建一個全新的表空間。 –

回答

1

找到解決方案:

今天的系統通常運行在格式化爲GPT的磁盤上。這是因爲Windows 10需要安裝這樣的分區。問題是MySql不能處理這種分區風格,所以它崩潰了。這裏是我的解決方法:

  • 創建虛擬磁盤:manual here
  • 格式這個VHD與MBR
  • 您的新VHD安裝MySQL的自定義(不要忘記創建數據庫用戶)

這應該是它! :)