mysql8.0找不到my.ini配置文件的問題及解決
mysql 8.0找不到my.ini配置文件
“mysql 8.0 來了,該更新版本了”
為了方便日后的工作,在這里整理了一下mysql的基本配置
新建my.ini配置文件
有些時候需要設(shè)置mysql的屬性,一般的可以通過以下方式找到my.ini文件的路徑
mysql> show variables like 'datadir'; +---------------+--------------------------------------------+ | Variable_name | Value | +---------------+--------------------------------------------+ | datadir | C:\ProgramData\MySQL\MySQL Server 8.0\ | +---------------+--------------------------------------------+ 1 row in set (0.03 sec)
執(zhí)行結(jié)果就是配置文件的路徑
注:可以通過select @@basedir; 獲取到mysql的安裝路徑
但是筆者的mysql有點(diǎn)傲嬌,不太一樣:
mysql> show variables like 'datadir'; +---------------+--------------------------------------------+ | Variable_name | Value | +---------------+--------------------------------------------+ | datadir | C:\install\mysql\mysql-8.0.16-winx64\data\ | +---------------+--------------------------------------------+ 1 row in set (0.03 sec)
并且該目錄下根本就沒有my.ini配置文件。。。。。
嘿嘿~~ 那就新建一個!
比如在這里新建一個空的my.ini:
C:\install\mysql\mysql-8.0.16-winx64\my.ini
內(nèi)容可以copy一份這里的
# 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:\MySQL datadir = D:\MySQL\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
或者只加入自己想要的配置,例如:
[mysqld] ft_min_word_len=1
然后打開cmd,進(jìn)入命令行,輸入:
mysqld --defaults-file="C:\install\mysql\mysql-8.0.16-winx64\my.ini"
即修改mysql的配置文件路徑
嘿嘿 _
重啟mysql服務(wù)即可,查看是否生效,可以執(zhí)行類似的命令:
mysql> show variables like '%ft%'; +---------------------------------+----------------+ | Variable_name | Value | +---------------------------------+----------------+ | ft_boolean_syntax | + -><()~*:""&| | | ft_min_word_len | 1 | +---------------------------------+----------------+ 17 rows in set (0.03 sec)
如果還沒有安裝mysql服務(wù),那更加好,只需要在安裝的時候輸入即可:
mysqld --install "MySql80" --defaults-file="C:\install\mysql\mysql-8.0.16-winx64\my.ini"
總結(jié)
以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關(guān)文章
Linux 安裝JDK Tomcat MySQL的教程(使用Mac遠(yuǎn)程訪問)
這篇文章主要介紹了Linux 安裝JDK Tomcat MySQL(使用Mac遠(yuǎn)程訪問),本文圖文并茂給大家介紹的非常詳細(xì),具有一定的參考借鑒價值,需要的朋友可以參考下2018-06-06在linux中導(dǎo)入sql文件的方法分享(使用命令行轉(zhuǎn)移mysql數(shù)據(jù)庫)
為使用阿里云主機(jī),沒有裝ftp,也沒有裝phpmyadmin,所以一切都得靠命令行。轉(zhuǎn)移網(wǎng)站的重要一步就是轉(zhuǎn)移數(shù)據(jù)庫,這里簡單介紹一下如何在這種情況下導(dǎo)入sql文件2014-02-02Ubuntu下取消MySQL數(shù)據(jù)庫本機(jī)綁定限制方法
在Ubuntu系統(tǒng)中,添加了MySQL賬戶,賦予了數(shù)據(jù)庫完全操作權(quán)限,并且允許數(shù)據(jù)庫從外部鏈接 但是,還是無法遠(yuǎn)程訪問MySQL數(shù)據(jù)庫2013-06-06centos7.4系統(tǒng)中yum源安裝mysql 5.6
本文給大家介紹的是如何在centos7.4系統(tǒng)中通過yum源安裝MySQL 5.6數(shù)據(jù)庫,CentOS7默認(rèn)數(shù)據(jù)庫是mariadb, 但是 好多用的都是mysql ,但是CentOS7的yum源中默認(rèn)好像是沒有mysql的,今天我們就來看看具體如何操作2018-09-09vs如何讀取mysql中的數(shù)據(jù)并解決中文亂碼問題
這篇文章主要介紹了vs如何讀取mysql中的數(shù)據(jù)并解決中文亂碼問題,文章圍繞主題展開詳細(xì)的內(nèi)容介紹,具有一定的參考價值,需要的小伙伴可以參考一下2022-09-09MYSQL數(shù)據(jù)庫數(shù)據(jù)拆分之分庫分表總結(jié)
這篇文章主要介紹了MYSQL數(shù)據(jù)庫數(shù)據(jù)拆分之分庫分表總結(jié),需要的朋友可以參考下2016-07-07MySQL之FIELD()與ORDER BY()相結(jié)合實(shí)現(xiàn)對結(jié)果的自定義排序方式
這篇文章主要介紹了MySQL之FIELD()與ORDER BY()相結(jié)合實(shí)現(xiàn)對結(jié)果的自定義排序方式,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教2024-04-04