概述
一直用的免安装版本,突然有一天开发时控制台一直报错
Data source rejected establishment of connection, message from server: “Too many connections”
上网搜
说是要我修改最大连接,然后我左找右找没找到my.ini/my-default.ini。
不管是c:下的programData还是安装目录,所以直接新建一个使用。
直接新建文本文件就行,改后缀。
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 = D:SoftwareMySqlmysql-8.0.26-winx64
datadir = D:SoftwareMySqlmysql-8.0.26-winx64data
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
需要注意的一点是
这里填自己安装目录。
不知道的话查询一下:show variables like ‘datadir’;
指定一下
mysqld --defaults-file="D:SoftwareMySqlmysql-8.0.26-winx64my.ini"
测试一下;修改最大连接
===>
最后
以上就是曾经小霸王为你收集整理的mysql 免安装版找不到my.ini配置文件的全部内容,希望文章能够帮你解决mysql 免安装版找不到my.ini配置文件所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复