mysql8.0.20免安装初始化步骤记录
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                mysql8.0.20免安装初始化步骤记录
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.                        
                                一.新增my.ini
文件內容如下:
# For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.7/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.[mysqld] #skip-grant-tables # 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 = ..... # datadir = ..... # port = ..... # server_id = ..... basedir ="C:\MySql\mysql-8.0.20-winx64 # 設置mysql的安裝目錄 datadir ="C:\MySql\mysql-8.0.20-winx64\data" # 設置mysql數據庫的數據的存放目錄,必須是data,或者是//xxx/data # 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 = 2M # read_rnd_buffer_size = 2M sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES #服務端的編碼方式 character-set-server=utf8mb4 [client] #客戶端編碼方式,最好和服務端保存一致 loose-default-character-set=utf8mb4[WinMySQLadmin] Server = "C:\MySql\mysql-8.0.20-winx64\bin\mysqld.exe"二.修改環境變量
計算機——屬性——高級系統設置——環境變量
 選擇path新增mysql安裝bin目錄路徑
三.初始化
在bin目錄下cmd運行
3.1.mysqld --initialize --console
執行過后找到A temporary password is generated for root@localhost: 這句,localhost后面就是自己的初始化密碼。
若此時彈出缺少MSVCP140.dll,安裝VC_redist.exe。
 若報錯ound option without preceding group in config file:,將my.ini文件編碼方式由utf-8改為ANSI
 
3.2.net start mysql
啟動服務,則輸入
若服務名無效
 輸入 mysqld --install
若要刪除mysql,可執行命令
mysqld --remove mysql3.3.mysql -u root -p
進行登錄數據庫,這時提示需要密碼,然后就是用上面的密碼登錄
3.4.修改密碼
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456'; 或 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';修改密碼為:123456
四.新增賬戶
create user 'demo'@'%' identified with mysql_native_password BY '123456';五.修改權限:
grant all privileges on *.* to 'demo'@'%' with grant option;六.刷新
flush privileges;七.備份
mysqldump -udemo -p123456 demo table >baktable.sql; --single-transaction 鎖定數據庫防止其他事物操作導致數據不一致 ### 七.導入庫 source七.刪除庫
drop database demo;總結
以上是生活随笔為你收集整理的mysql8.0.20免安装初始化步骤记录的全部內容,希望文章能夠幫你解決所遇到的問題。
                            
                        - 上一篇: 艺术 NFT 的发展之路
 - 下一篇: PCB快速打样规范