ITPub博客

首页 > 数据库 > MySQL > Windows11二进制方式安装MySQL5.7.44

Windows11二进制方式安装MySQL5.7.44

原创 MySQL 作者:zwl0626881 时间:2024-04-14 21:41:34 0 删除 编辑

解压安装包至C:\usr\local\mysql57\3307

新建

E:\data\mysql57\3307\mysqldata

E:\data\mysql57\3307\mysqllog

E:\data\mysql57\3307\mysqltmp


## SYSTEM ENVIRONMENT PARAMETERS

MYSQL_HOME=C:\usr\local\mysql57\3307

path=......;%MYSQL_HOME%\bin


## 编辑配置文件

将my-defaults.ini备份,修改文件名为my.ini

编辑my.ini


## 管理员身份运行cmd/终端

C:\Windows\system32> mysqld --version

mysqld  Ver 5.7.44 for Win64 on x86_64 (MySQL Community Server (GPL))

#### mysqld --initialize --basedir=C:\opt\mysql --datadir=C:\opt\mysqldata --init-file=C:\opt\mysqldata\init.txt

#### 注:使用–initialize-insecure生成空密码。使用–initialize生成随机初始默认密码,

C:\Windows\system32> mysqld --initialize --basedir=C:\usr\local\mysql57\3307 --datadir=E:\data\mysql57\3307\mysqldata\

C:\usr\local\mysql57\3307\mysqllog> type E:\data\mysql57\3307\mysqllog\mysql57_3307.err

2016-08-31T07:44:37.510047Z 1 [Note] A temporary password is generated for root@localhost: ggIx)PR:3Rx. 

##密码带"."   密码用双引号"ggIx)PR:3Rx."


## 如果执行mysqld --initialize-secure --basedir=C:\usr\local\mysql57\3307 --datadir=E:\data\mysql57\3307\mysqldata

## 则生成密码为空

## 执行SET PASSWORD FOR 'root'@'localhost' = PASSWORD('6');


## 安装服务

## mysqld --install

## mysqld --install-manual

mysqld --install mysql57_3307


C:\opt\mysql\bin> mysql -u root -p"Jmcb)K.1Lv_d"

...

Server version: 5.7.44-log

...

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('6');

Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;

Query OK, 0 rows affected (0.01 sec)



## 附件《Windows安装配置文件5.7(3307) my.ini》

[mysqld]

#### database configure

basedir= C:\usr\local\mysql57\3307

datadir= E:\data\mysql57\3307\mysqldata\

tmpdir= E:\data\mysql57\3307\mysqltmp

user=mysql

port=3307

symbolic-links=0

show_compatibility_56=1



#### memory configure

sort_buffer_size=3M

table_open_cache=4096


#### connection configuration

max_connections=2000

max_allowed_packet=1024M

connect_timeout=60

net_read_timeout=60


#### skip configuration

# skip-name-resolve


#### innodb_configuration

default_storage_engine=InnoDB

innodb_file_per_table=1

innodb_open_files=4096

innodb_buffer_pool_size=2048M

innodb_log_group_home_dir= E:\data\mysql57\3307\mysqllog

innodb_log_files_in_group=4

innodb_log_file_size=64M

innodb_log_buffer_size=32M

innodb_page_size=16384


#### sql configuration

sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'

group_concat_max_len=1024000


#### object_configuration

event_scheduler=1

log_bin_trust_function_creators=1


#### character set

character-set-server=utf8

collation-server=utf8_general_ci

lower-case-table-names=1


#### log configure

pid-file= E:\data\mysql57\3307\mysqltmp\mysqld.pid

log-error= E:\data\mysql57\3307\mysqllog\mysql57_3307.err

log-bin= E:\data\mysql57\3307\mysqllog\mysql57_3307-bin

slow-query-log=1

long-query-time=1

slow-query-log-file= E:\data\mysql57\3307\mysqllog\mysql57_3307-slow.log

socket= E:\data\mysql57\3307\mysqltmp\mysql.sock

relay-log= E:\data\mysql57\3307\mysqllog\mysql57_3307-relay-bin

max_binlog_size=800M

innodb_flush_log_at_trx_commit=1


#### replication configure

server-id = 27

replicate-wild-ignore-table = mysql.%

replicate-wild-ignore-table = information_schema.%

replicate-wild-ignore-table = performance_schema.%

replicate-wild-ignore-table = sys.%

binlog-format=ROW

binlog-row-image=full

binlog-rows-query-log-events=1

sync_binlog=1

log-slave-updates=true

gtid-mode=on

enforce-gtid-consistency=true


#### time configure

explicit_defaults_for_timestamp=true

default_time_zone='+8:00'


[client]

socket= E:\data\mysql57\3307\mysqltmp\mysql.sock


[mysql]

prompt='local_mysql57_3307> '



来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22581916/viewspace-3012496/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2011-12-02

  • 博文量
    1
  • 访问量
    3300