mysql5.6.17 my.ini文件,mysql根目录下找不到my.ini文件,重新创建my.ini

1,首先我按照了网上的打开隐藏文件,还是找不到my.ini(打开隐藏文件的方法:

8c4dd74ed5bc21a74326a9f7d988b1f9.png

2,如果1方法找到了。。就不用看2了。如果没找到就接受现实,需要自己创建my.ini然后重新配置。

(1)管理员运行cmd,前提是配置了mysql环境,输入如下删除mysql服务:

sc delete Mysql80

(2)在mysql根目录下创建my.ini,写入:

# For advice on how to change settings please see

# http://dev.mysql.com/doc/refman/5.6/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.

[client]

default-character-set = utf8mb4

[mysql]

default-character-set = utf8mb4

[mysqld]

character-set-client-handshake = FALSE

character-set-server = utf8mb4

collation-server = utf8mb4_bin

init_connect='SET NAMES utf8mb4'

# 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 = S:\mysql\mysql-8.0.17-winx64

datadir = S:\mysql\mysql-8.0.17-winx64\data

port = 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 = 16M

read_rnd_buffer_size = 16M

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

basedir = S:\mysql\mysql-8.0.17-winx64

datadir = S:\mysql\mysql-8.0.17-winx64\data 根据自己程序所在地写

(4)对data数据进行备份

我是使用的navicat对数据库进行备份,如下:

31a34508fb24aeb33d026ca891f09f09.png

然后删除data文件夹,在cmd中输入(此时会重新生成data文件夹):

mysqld --initialize-insecure --user=mysql

(5)绑定my.ini文件:

mysqld --install "mysql" --defaults-file="S:\mysql\mysql-8.0.17-winx64\my.ini"

(6)安装好了,使用cmd启动就可以了。此时初始密码为空,启动时需要输密码直接回车就好啦。

标签:set,data,server,ini,mysql,根目录,my

来源: https://blog.csdn.net/weixin_45100596/article/details/100085122

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值