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)會提示你輸入密碼。輸入密碼后按回車即可登錄。
Step2 嘗試找到my.ini文件的路徑
show variables like 'datadir';
但是該目錄下根本就沒有my.ini配置文件
新建my.ini文件
Step 1 在桌面新建一個txt文件
我的C:\Program Files\MySQL\MySQL Server 8.0下只能創(chuàng)建文件夾,所以要在別的地方創(chuàng)建空的my.ini文件
Step 2 修改txt文件為ini文件
通過重命名的方式將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ù)
注:替換為你電腦的路徑(如果沒有Data文件夾,需要創(chuàng)建好)
Step 3 修改mysql的配置文件路徑
打開cmd,進入命令行,輸入(注:替換為你電腦的路徑):
mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server 8.0\my.ini"
重啟 MySQL 服務(wù)
打開任務(wù)管理器
打開任務(wù)管理器,選擇“服務(wù)”
重啟 MySQL 服務(wù)
找到 MySQL,右鍵,選擇“重新啟動”
查看 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)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
InnoDB 類型MySql恢復(fù)表結(jié)構(gòu)與數(shù)據(jù)
MySQL中.frm文件:保存了每個表的元數(shù)據(jù),包括表結(jié)構(gòu)的定義等,該文件與數(shù)據(jù)庫引擎無關(guān)。MySQL中.ibd文件:InnoDB引擎開啟了獨立表空間(my.ini中配置innodb_file_per_table = 1)產(chǎn)生的存放該表的數(shù)據(jù)和索引的文件。2018-01-01MySQL全文索引、聯(lián)合索引、like查詢、json查詢速度哪個快
這篇文章主要介紹了MySQL全文索引、聯(lián)合索引、like查詢、json查詢速度大比拼,通過實例代碼截圖的形式給大家介紹的非常詳細,具有一定的參考借鑒價值,需要的朋友可以參考下2020-02-02mysql5.7.13 環(huán)境搭建教程(解壓縮版)
這篇文章主要為大家詳細介紹了mysql解壓縮版環(huán)境搭建教程,具有一定的實用性,感興趣的小伙伴們可以參考一下2016-07-07非常實用的MySQL函數(shù)全面總結(jié)詳解示例分析教程
這篇文章主要為大家介紹了非常實用的MySQL函數(shù)的詳解示例分析,文中全面的概括了MySQL函數(shù),并進行了詳細的示例講解,有需要的朋友可以借鑒參考下2021-10-10專業(yè)級的MySQL開發(fā)設(shè)計規(guī)范及SQL編寫規(guī)范
這篇文章主要介紹了專業(yè)級的MySQL開發(fā)設(shè)計規(guī)范及SQL編寫規(guī)范,需要的朋友可以參考下2020-11-11