mysql中找不到my.ini文件的問題及解決
mysql找不到my.ini文件
問題描述
剛剛在修改mysql默認配置的時候,發(fā)現(xiàn)找不到my.ini文件。按照其他搬運工的說法,打開隱藏的文件也是不行。自己摸索了半天終于找到解決方案。
解決辦法
1、打開“隱藏文件”顯示:
2、在url哪里輸入: %ProgramData%
2.1、回車以后會得到如下結(jié)果,打開mysql文件夾
2.2、然后會得到如下
打開MySQLServer那個文件夾里面就會有my.ini文件了。
mysql免安裝版找不到my.ini配置文件
一直用的免安裝版本,突然有一天開發(fā)時控制臺一直報錯
Data source rejected establishment of connection, message from server: “Too many connections”
上網(wǎng)搜
說是要我修改最大連接,然后我左找右找沒找到my.ini/my-default.ini。
不管是c:\下的programData還是安裝目錄,所以直接新建一個使用。
直接新建文本文件就行,改后綴。
my.ini里面的內(nèi)容
# 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:\Software\MySql\mysql-8.0.26-winx64 datadir = D:\Software\MySql\mysql-8.0.26-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
需要注意的一點是
這里填自己安裝目錄。
不知道的話查詢一下:show variables like ‘datadir’;
指定一下
mysqld --defaults-file="D:\Software\MySql\mysql-8.0.26-winx64\my.ini"
測試一下;修改最大連接
===>
以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關文章
MySQL學習第四天 Windows 64位系統(tǒng)下使用MySQL
MySQL學習第四天教大家如何在Windows 64位下使用MySQL,即使用命令行方式完成操作MySQL服務,感興趣的小伙伴們可以參考一下2016-05-05簡析mysql字符集導致恢復數(shù)據(jù)庫報錯問題
這篇文章主要介紹了簡析mysql字符集導致恢復數(shù)據(jù)庫報錯問題,具有一定參考價值,需要的朋友可以了解。2017-10-10MySQL數(shù)據(jù)庫操作DML?插入數(shù)據(jù),刪除數(shù)據(jù),更新數(shù)據(jù)
這篇文章主要介紹了MySQL數(shù)據(jù)庫操作DML插入數(shù)據(jù),刪除數(shù)據(jù),更新數(shù)據(jù),DML是指數(shù)據(jù)操作語言,英文全稱是Data?Manipulation?Language,用來對數(shù)據(jù)庫中表的數(shù)據(jù)記錄進行更新2022-07-07MySQL一次性創(chuàng)建表格存儲過程實戰(zhàn)
這篇文章主要介紹了MySQL一次性創(chuàng)建表格存儲過程實戰(zhàn),文章圍繞主題展開詳細的內(nèi)容介紹,具有一定的參考價值,需要的朋友可以參考一下2022-07-07mysql too many open connections問題解決方法
這篇文章主要介紹了mysql too many open connections問題解決方法,其實是max_connections配置問題導致,它必須在[mysqld]下面才會生效,需要的朋友可以參考下2014-05-05