【MySQL8.0.32安装】Windows Server2019安装MySQL8.0.32
- 安装包下载:
https://downloads.mysql.com/archives/community/
下载mysql-8.0.32-winx64.zip
- 1、制定目录配置
basedir=D:\\mysql8.0.32
#mysql数据存放目录
datadir=D:\\mysql8.0.32\\data
将.zip压缩包解压到D盘,并重命名为mysql8.0.32
- 2、编辑my.ini文件
[client] #max_allowed_packet=32M # pipe # socket=0.0 port=3306 [mysql] no-beep #max_allowed_packet=32M default-character-set=utf8 [mysqld] max_allowed_packet=256M interactive_timeout=31536000 wait_timeout=300 group_concat_max_len=102400 early-plugin-load=keyring_file.dll keyring_file_data=D:/mysql-8.0.32/data #关闭SSL skip-ssl plugin-load=validate_password.dll validate_password_policy=1 validate-password=FORCE_PLUS_PERMANENT validate_password_number_count=1 validate_password_special_char_count=1 plugin-load-add=connection_control.dll connection-control=FORCE_PLUS_PERMANENT connection-control-failed-login-attempts=FORCE_PLUS_PERMANENT connection_control_failed_connections_threshold=10 port=3306 character-set-server=utf8mb4 default-storage-engine=INNODB sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" basedir="D:/mysql-8.0.32/" # Path to the database root datadir="D:/mysql-8.0.32/data/" innodb_data_home_dir="D:/mysql-8.0.32/data/" innodb_data_file_path=ibdata1:10M:autoextend innodb_log_group_home_dir="D:/mysql-8.0.32/data/" innodb_file_per_table=1 log-error="D:/mysql-8.0.32/logs/mysql.err" pid-file="D:/mysql-8.0.32/tmp/mysql.pid" #socket="D:/mysql-8.0.32/tmp/mysql.socket" # General and Slow logging. #log-output=FILE #general-log=1 #general_log_file="mysqlgenaral.log" #slow-query-log=1 #slow_query_log_file="mysqlslow.log" #long_query_time=3 # Server Id. server-id=33061 # Binary Logging. log-bin="D:/mysql-8.0.32/logs/mysql-bin" binlog_format=row expire_logs_days=7 log_bin_trust_function_creators=on max_connections=2000 max_connect_errors=1000 query_cache_size=0 query_cache_type=0 table_open_cache=2048 tmp_table_size=203M thread_cache_size=32 myisam_max_sort_file_size=100G myisam_sort_buffer_size=395M key_buffer_size=64M read_buffer_size=8M read_rnd_buffer_size=8M innodb_flush_log_at_trx_commit=1 innodb_log_buffer_size=16M innodb_buffer_pool_size=10G innodb_log_file_size=512M innodb_thread_concurrency=16 innodb_autoextend_increment=64 innodb_buffer_pool_instances=8 innodb_concurrency_tickets=5000 innodb_old_blocks_time=1000 innodb_open_files=300 innodb_stats_on_metadata=0 innodb_checksum_algorithm=0 back_log=80 flush_time=0 join_buffer_size=16M open_files_limit=4161 sort_buffer_size=16M table_definition_cache=1400 binlog_row_event_max_size=8K
- 3、这里采用管理员用户administrator进行安装
D:/mysql-8.0.32/bin/mysqld --initialize
D:/mysql-8.0.32/bin/net start mysql
初始化输入这个命令可以查看初始密码 mysqld --initialize --console
net start mysql 可能失败。
修改密码
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';