本人用阿里云的云服务器搭建一个网站练习,不知道在Window Server 2012R2系统下如何搭建MySQL,经过度娘终于解决,所以再次记入步骤以防下次搭建忘记。
1、在MySQL官网下载软件压缩包
2、解压完后,放到相应的硬盘中,我放的位置是E盘。然后将解压后文件夹中的my-default.ini这个配置文件复制一份并将其命名为my.ini。然后将里面的内容修改为如下
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[client]
default-character-set=utf8
port=3306
[mysqld]
port=3306
character_set_server=utf8
basedir ="E:\MySQL\mysql-5.7.17-winx64"
datadir ="E:\MySQL\mysql-5.7.17-winx64/data/"
tmpdir ="E:\MySQL\mysql-5.7.17-winx64/data/"
socket ="E:\MySQL\mysql-5.7.17-winx64/data/mysql.sock"
log-error="E:\MySQL\mysql-5.7.17-winx64/data/mysql_error.log"
character_set_server=utf8
#server_id = 2
#skip-locking
max_connections=100
table_open_cache=256
query_cache_size=1M
tmp_table_size=32M
thread_cache_size=8
innodb_data_home_dir="E:\MySQL\mysql-5.7.17-winx64\data"
innodb_flush_log_at_trx_commit =1
innodb_log_buffer_size=128M
innodb_buffer_pool_size=128M
innodb_log_file_size=10M
innodb_thread_concurrency=16
innodb-autoextend-increment=1000
join_buffer_size = 128M
sort_buffer_size = 32M
read_rnd_buffer_size = 32M
max_allowed_packet = 32M
explicit_defaults_for_timestamp=true
#sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES