日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

mysql8.0.20免安装初始化步骤记录

發(fā)布時間:2023/12/15 数据库 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mysql8.0.20免安装初始化步骤记录 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

一.新增my.ini

文件內(nèi)容如下:

# 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 # 設(shè)置mysql的安裝目錄 datadir ="C:\MySql\mysql-8.0.20-winx64\data" # 設(shè)置mysql數(shù)據(jù)庫的數(shù)據(jù)的存放目錄,必須是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 #服務(wù)端的編碼方式 character-set-server=utf8mb4 [client] #客戶端編碼方式,最好和服務(wù)端保存一致 loose-default-character-set=utf8mb4[WinMySQLadmin] Server = "C:\MySql\mysql-8.0.20-winx64\bin\mysqld.exe"

二.修改環(huán)境變量

計算機(jī)——屬性——高級系統(tǒng)設(shè)置——環(huán)境變量
選擇path新增mysql安裝bin目錄路徑

三.初始化

在bin目錄下cmd運(yùn)行

3.1.mysqld --initialize --console

執(zhí)行過后找到A temporary password is generated for root@localhost: 這句,localhost后面就是自己的初始化密碼。

若此時彈出缺少M(fèi)SVCP140.dll,安裝VC_redist.exe。


若報錯ound option without preceding group in config file:,將my.ini文件編碼方式由utf-8改為ANSI

3.2.net start mysql

啟動服務(wù),則輸入

若服務(wù)名無效
輸入 mysqld --install

若要刪除mysql,可執(zhí)行命令

mysqld --remove mysql

3.3.mysql -u root -p

進(jìn)行登錄數(shù)據(jù)庫,這時提示需要密碼,然后就是用上面的密碼登錄

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';

五.修改權(quán)限:

grant all privileges on *.* to 'demo'@'%' with grant option;

六.刷新

flush privileges;

七.備份

mysqldump -udemo -p123456 demo table >baktable.sql; --single-transaction 鎖定數(shù)據(jù)庫防止其他事物操作導(dǎo)致數(shù)據(jù)不一致 ### 七.導(dǎo)入庫 source

七.刪除庫

drop database demo;

總結(jié)

以上是生活随笔為你收集整理的mysql8.0.20免安装初始化步骤记录的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。