1. 程式人生 > >mysql8 安裝啟動報錯

mysql8 安裝啟動報錯

注意點1

my.ini配置,其中這兩項一定要按這個格式,雙引號及雙反斜槓,否則初始化時會報下面的錯

basedir = "D:\\tool\\MYSQL\\mysql-8.0.12-winx64"
datadir = "D:\\tool\\MYSQL\\mysql-8.0.12-winx64\\data"

[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
basedir = "D:\\tool\\MYSQL\\mysql-8.0.12-winx64"
datadir = "D:\\tool\\MYSQL\\mysql-8.0.12-winx64\\data"
port = 3307
# server_id = .....


# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M 

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

character-set-server = utf8mb4

performance_schema_max_table_instances = 600
table_definition_cache = 400
table_open_cache = 256

[mysql]
default-character-set = utf8mb4

[client]
default-character-set = utf8mb4

D:\tool\MYSQL\mysql-8.0.12-winx64\bin>mysqld --initialize --console
mysqld: Can't create/write to file 'D:  ool\MYSQL\mysql-8.0.12-winx64\data\is_writable' (OS errno 2 - No such file or directory)
2018-09-19T01:51:48.238868Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. 
They will be merged with strict mode in a future release.
2018-09-19T01:51:48.243868Z 0 [System] [MY-013169] [Server] D:\tool\MYSQL\mysql-8.0.12-winx64\bin\mysqld.exe (mysqld 8.0.12) initializing of server in progress
as process 8492
2018-09-19T01:51:48.243868Z 0 [ERROR] [MY-010338] [Server] Can't find error-message file 'D:\tool\MYSQL\mysql-8.0.12-winx64\bin\        ool\MYSQL\mysql-8.0.12-w
inx64\share\errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2018-09-19T01:51:48.246869Z 0 [ERROR] [MY-010460] [Server] --initialize specified but the data directory exists and is not writable. Aborting.
2018-09-19T01:51:48.248869Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-09-19T01:51:48.249869Z 0 [System] [MY-010910] [Server] D:\tool\MYSQL\mysql-8.0.12-winx64\bin\mysqld.exe: Shutdown complete (mysqld 8.0.12)  MySQL Community
 Server - GPL.

 

 

注意點2

如果mysql 啟動時卡住,再次啟動或者停止時會提示:服務正在啟動或停止中,請稍候片刻後再試一次。

但程序中確找不到mysqld的程序,是因為未勾選“顯示所有使用者的程序”