MySQL 8.0找不到 my.ini 配置文件(并開啟 Binlog 監(jiān)聽)
使用管理員權(quán)限打開cmd(命令提示符)
Step1 win+R

Step2 輸入 cmd

Step3 Ctrl+Shift+Enter

嘗試找到my.ini配置文件路徑
Step1 打開 MySQL
mysql -u 用戶名 -p
-u 后面跟的是 MySQL 用戶名(如 root)。
-p 表示需要輸入密碼。
輸入命令后,按回車鍵,系統(tǒng)會(huì)提示你輸入密碼。輸入密碼后按回車即可登錄。
Step2 嘗試找到my.ini文件的路徑
show variables like 'datadir';

但是該目錄下根本就沒(méi)有my.ini配置文件
新建my.ini文件
Step 1 在桌面新建一個(gè)txt文件
我的C:\Program Files\MySQL\MySQL Server 8.0下只能創(chuàng)建文件夾,所以要在別的地方創(chuàng)建空的my.ini文件

Step 2 修改txt文件為ini文件
通過(guò)重命名的方式將txt文件修改為int文件 “新建 文本文檔.txt” -> “my.ini”

打開 my.ini,復(fù)制以下內(nèi)容到 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. lc-messages-dir = C:\\Program Files\\MySQL\\MySQL Server 8.0\\share basedir = C:\\Program Files\\MySQL\\MySQL Server 8.0 datadir = C:\\Program Files\\MySQL\\MySQL Server 8.0\\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 log-bin=mysql-bin # 開啟 binlog binlog-format=ROW # 選擇 ROW 模式 server_id=1 # 配置 MySQL replaction 需要定義,不要和 canal 的 slaveId 重復(fù)
注:替換為你電腦的路徑(如果沒(méi)有Data文件夾,需要?jiǎng)?chuàng)建好)

Step 3 修改mysql的配置文件路徑
打開cmd,進(jìn)入命令行,輸入(注:替換為你電腦的路徑):
mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server 8.0\my.ini"
重啟 MySQL 服務(wù)
打開任務(wù)管理器
打開任務(wù)管理器,選擇“服務(wù)”

重啟 MySQL 服務(wù)
找到 MySQL,右鍵,選擇“重新啟動(dòng)”

查看 Binlog 日志是否開啟
執(zhí)行 MySQL 執(zhí)行命令查看 Binlog 日志是否開啟。
show variables like 'log_%';
如果查詢出的選型 log_bin 數(shù)據(jù)為 ON,Binlog 即為開啟狀態(tài)。輸出如下:

到此這篇關(guān)于MySQL 8.0找不到 my.ini 配置文件(并開啟 Binlog 監(jiān)聽)的文章就介紹到這了,更多相關(guān)MySQL 8.0找不到 my.ini 內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
MySQL數(shù)據(jù)庫(kù)數(shù)據(jù)刪除操作詳解
本文我們將要學(xué)習(xí)的是作為刪除數(shù)據(jù)使用的?“DELETE”?語(yǔ)句,“DELETE”?語(yǔ)句是用來(lái)刪除數(shù)據(jù)的,它不能用來(lái)刪除數(shù)據(jù)表本身。刪除數(shù)據(jù)表使用的是?“DROP”?語(yǔ)句,而?“DELETE”?的作用只是用來(lái)刪除記錄而已2022-08-08
mysql如何對(duì)String類型的數(shù)字值排序
這篇文章主要介紹了mysql如何對(duì)String類型的數(shù)字值排序問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-08-08
CentOS Mysql數(shù)據(jù)庫(kù)如何實(shí)現(xiàn)定時(shí)備份
這篇文章主要介紹了CentOS Mysql數(shù)據(jù)庫(kù)如何實(shí)現(xiàn)定時(shí)備份,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2020-06-06
MySQL如何快速批量插入1000w條數(shù)據(jù)
這篇文章主要給大家介紹了關(guān)于MySQL如何快速批量插入1000w條數(shù)據(jù)的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2021-03-03
SQL使用復(fù)合索引實(shí)現(xiàn)數(shù)據(jù)庫(kù)查詢的優(yōu)化
這篇文章主要介紹了SQL使用復(fù)合索引實(shí)現(xiàn)數(shù)據(jù)庫(kù)查詢的優(yōu)化,文章圍繞主題展開詳細(xì)的內(nèi)容介紹,具有一定的參考價(jià)值,需要的小伙伴可以參考一下2022-05-05
mysql出現(xiàn)ERROR 1819 (HY000)的解決方法
這篇文章主要為大家詳細(xì)介紹了mysql出現(xiàn)ERROR 1819 (HY000)的解決方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2016-10-10
mysql 啟動(dòng)錯(cuò)誤1067 問(wèn)題及解決方法
這篇文章主要介紹了mysql 啟動(dòng)錯(cuò)誤1067 問(wèn)題及解決方法的相關(guān)資料,需要的朋友可以參考下2016-11-11

