mysql解压data_windows mysql 解压版 data文件初始化

本文介绍了如何在个人电脑上安装MySQL,包括使用mysqld命令初始化数据库,设置root用户的密码,以及配置my.ini文件来指定数据库路径和设置相关参数。在安装过程中,需要注意数据目录的创建,以及服务的启动和停止。
摘要由CSDN通过智能技术生成

在自己电脑上玩一个mysql 在官网下载了,发现压缩包里面没有data文件夹,各种搜索都是copy一个data文件夹。这让我去那里copy。

终于找到一个 初始化的命令,mark。

命令行执行: mysqld --initialize --user=mysql --console

先执行以上命令, 生成库. 注意有个临时密码, 要记下来.

然后启动服务.

然后再命令行:

mysql -uroot -p

输入密码,

再输入:

set password = password('root')

mysql

移除服务

mysqld -remove

安装服务

mysqld -install

关闭服务

net stop mysql

启动服务

net start mysql

my.ini

# For advice on how to change settings please see

# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html

# *** 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.

[mysqld]

port = 3306

#设置字符集为utf8

default-storage-engine=INNODB

character-set-server=utf8

collation-server=utf8_general_ci

#创建表区分大小写,保持和linux 同意

lower_case_table_names = 2

basedir=D:/ProgramFiles/mysql/mysql-5.7.10-winx64

datadir = D:/ProgramFiles/mysql/mysql-5.7.10-winx64/data

# 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 = .....

# datadir = .....

# port = .....

# 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

[client]

port = 3306

default-character-set=utf8

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值