MySQL5.7免安装教程
安装包: 下载地址

第一步:解压到要安装的目录,这里解压出来缺少一个data文件夹和一个my.ini文件,需要自己创建

第二步:创建data文件夹和my.ini配置文件

第三步:填写my.ini的内容
[client]
port=3306
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
basedir="D:\MySQL57\mysql-5.7.28-winx64" ##这是安装目录
datadir="D:\MySQL57\mysql-5.7.28-winx64\data" ##自己创建的data文件夹路径
explicit_defaults_for_timestamp=true
port=3306
server_id=1
character-set-server=utf8
default-storage-engine=INNODB
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
log-output=FILE
general-log=0
general_log_file="123-PC.log"
slow-query-log=1
slow_query_log_file="123-PC-slow.log"
long_query_time=10
max_connections=151
query_cache_size=0
table_open_cache=2000
tmp_table_size=25M
thread_cache_size=10
myisam_max_sort_file_size=100G
myisam_sort_buffer_size=42M
key_buffer_size=8M
read_buffer_size=64K
read_rnd_buffer_size=256K
sort_buffer_size=256K
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1M
innodb_buffer_pool_size=8M
innodb_log_file_size=48M
innodb_thread_concurrency=9
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_file_per_table=1
innodb_checksum_algorithm=0
back_log=80
flush_time=0
join_buffer_size=256K
max_allowed_packet=4M
max_connect_errors=100
open_files_limit=4161
query_cache_type=0
sort_buffer_size=256K
table_definition_cache=1400
binlog_row_event_max_size=8K
sync_master_info=10000
sync_relay_log=10000
sync_relay_log_info=10000
[WinMySQLadmin]
Server=D:\MySQL57\mysql-5.7.28-winx64\bin\mysqld.exe ##这里的路径也需要写自己的
第四步:就要配置服务了,解压完成后是没有MySQL的服务的是需要手动安装添加,win+R进入cmd
,进入自己的安装的MySQL的bin目录
第五步:装在MySQL服务,mysqld --install
这里如果出现这样的提示
请下载Microsoft Visusal C++ 2013 Redistributable(x64)
地址链接
如果没有出现此提示忽略此步
第六步:初始化数据库
mysqld --initialize-insecure --user=MySQL57
第七步:启动MySQL服务
net start MySQL57
第八步:登录数据库修改密码
mysql –u root –p
当提示输入密码时,不用填写直接回车,然后执行
update mysql.user set authentication_string=password(‘123456789’) where user=‘root’ and Host = ‘localhost’
最后重启服务就ok了