MySql 8.0.11-Winxp64(免安装版)配置教程

1、MySQL8.0.16解压

1. 解压zip包到安装目录

其中dada文件夹和my.ini配置文件是解压后手动加入的,如下图所示

首先,将mysql-8.0.11-winx64.zip 解压缩到 安装D:/mysql-8.0.11-winx64 目录下,

2、新建配置文件my.ini放在D:Freemysql-8.0.16-winx64目录下

2.配置文件

[mysql]# 设置mysql客户端默认字符集default-character-set=utf8[mysqld]#设置3306端口port = 3306# 设置mysql的安装目录basedir=D:Freemysql-8.0.16-winx64# 设置mysql数据库的数据的存放目录datadir=D:Freemysql-8.0.16-winx64data# 允许最大连接数max_connections=200# 允许连接失败的次数。这是为了防止有人从该主机试图攻击数据库系统max_connect_errors=20# 服务端使用的字符集默认为8比特编码的latin1字符集character-set-server=utf8# 创建新表时将使用的默认存储引擎default-storage-engine=INNODB# 忽略密码# skip-grant-tables

在安装根目录下添加 my.ini

如图:

基本配置文件

3、初始化MYSQL配置

[mysqld]basedir = D:mysql-8.0.11-winx64datadir = D:mysql-8.0.11-winx64dataport = 3306lower_case_table_names = 2default_authentication_plugin=mysql_native_password

管理员身份打开Windows PowerShell,并进入D:Freemysql-8.0.16-winx64bin目录,执行如下命令:

参考 基本配置:

mysqld --initialize --console

[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:ProgramMySQLdatadir = D:DBsMySQLport = 3306# 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 = utf8mb4performance_schema_max_table_instances = 600table_definition_cache = 400table_open_cache = 256[mysql]default-character-set = utf8mb4[client]default-character-set = utf8mb4

执行成功后如下图所示:

3.初始化数据库

其中,[Note] [MY-010454] [Server] A temporary password is generated for root@localhost:后面的是初始化密码,即diK3i1dH=k8b

在MySQL安装目录的 bin 目录下执行命令:

初始化Mysql配置之后,data目录下会生成相关文件,如下所示

mysqld --initialize --console

4、安装MySQL服务,并启动服务

执行完成后,会打印 root 用户的初始默认密码,比如:

安装服务的命令为:mysqld --install 服务名,由于我电脑已配置安装了mysql服务,此处用mysql8作为服务名,如下所示

2018-04-20T02:35:01.507037Z 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-04-20T02:35:01.507640Z 0 [System] [MY-013169] [Server] D:ProgramMySQL8binmysqld.exe (mysqld 8.0.11) initializing of server in progress as process 110642018-04-20T02:35:01.508173Z 0 [ERROR] [MY-010340] [Server] Error message file 'D:ProgramMySQLshareenglisherrmsg.sys' had only 1090 error messages, but it should contain at least 4512 error messages. Check that the above file is the right version for this program!2018-04-20T02:35:05.464644Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: APWCY5ws&hjQ2018-04-20T02:35:07.017280Z 0 [System] [MY-013170] [Server] D:ProgramMySQL8binmysqld.exe (mysqld 8.0.11) initializing of server has completed

mysqld --install mysql8

其中,第4行的“APWCY5ws&hjQ”就是初始密码,在没有更改密码前,需要记住这个密码,后续登录需要用到。

启动服务命令为:net start 服务名

如果没记住,那也没事,删掉初始化的 datadir 目录,再执行一遍初始化命令,又会重新生成的。当然,也可以使用安全工具,强制改密码,用什么方法,自己随意。

net start mysql8

4.安装服务

如下截图

在MySQL安装目录的 bin 目录下执行命令:

本文由美高梅官方网站发布于数据统计,转载请注明出处:MySql 8.0.11-Winxp64(免安装版)配置教程

TAG标签:
Ctrl+D 将本页面保存为书签,全面了解最新资讯,方便快捷。