mysql 5.7.14 免安裝版注意事項(精)

lightwing發表於2021-09-09

相關閱讀:

MySql 5.7.14 安裝教程詳解(解壓版)

Mysql 5.7.14 使用常見問題彙總(推薦)

1、解壓

2、在目錄D:Program Filesmysql-5.7.14-winx64下複製my-default.ini,放在與其相同目錄下,名稱顯示為my.ini;

3、編輯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.[client]default-character-set=utf8[mysqld]# 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:Program Filesmysql-5.7.14-winx64datadir = D:Program Filesmysql-5.7.14-winx64datatmpdir = D:Program Filesmysql-5.7.14-winx64datasocket = D:Program Filesmysql-5.7.14-winx64datamysql.sockport = 3306# server_id = .....max_connections = 100table_open_cache = 256query_cache_size = 1Mtmp_table_size = 32Mthread_cache_size = 8innodb_data_home_dir = D:Program Filesmysql-5.7.14-winx64datainnodb_flush_log_at_trx_commit = 1innodb_log_buffer_size = 128Minnodb_buffer_pool_size = 128Minnodb_log_file_size = 10Minnodb_thread_concurrency = 16innodb-autoextend-increment = 1000# 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 join_buffer_size = 128Msort_buffer_size = 32Mread_rnd_buffer_size = 32Mmax_allowed_packet = 32Mexplicit_defaults_for_timestamp = truesql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

4、在解壓目錄D:Program Filesmysql-5.7.14-winx64下新建data檔案(不用在資料夾做其他操作)

5、以管理員身份進入cmd介面(必須是管理員)

6、切換至mysql解壓目錄bin下,初始化data目錄

輸入命令:mysqld --initialize-insecure (生成無密碼的root使用者)

或:mysqld --initialize(生成帶隨機密碼的root使用者)

7、初始化完成後啟動mysql服務

輸入命令:net start mysql

8、開始使用mysql

輸入命令:mysql -u root -p

9、停止mysql服務

輸入命令:net stop mysql

10、忘記root密碼後如何登入

  101、 關閉正在執行的MySQL服務。

  10.2、 開啟DOS視窗,轉到mysqlbin目錄。

  10.3、輸入mysqld --skip-grant-tables 回車。--skip-grant-tables 的意思是啟動MySQL服務的時候跳過許可權表認證。

  10.4、再開一個DOS視窗(因為剛才那個DOS視窗已經不能動了),轉到mysqlbin目錄。

  10.5、輸入mysql回車,如果成功,將出現MySQL提示符 >。

  10.6、連線許可權資料庫: use mysql; 。

  10.7、改密碼:update user set password=password("123") where user="root";(別忘了最後加分號) 。

  10.8、重新整理許可權(必須步驟):flush privileges; 。

  10.9、 退出 quit。

  10.10、登出系統,再進入,使用使用者名稱root和剛才設定的新密碼123登入。

11、修改root使用者密碼

5.7版本以前:

?

1 update user set authentication_string =password( 'root') where user = 'root;

5.7版本以後:

?

1 update user set password=password( 'root') where user = 'root;

以上所述是小編給大家介紹的mysql 5.7.14 免安裝版注意事項(精),希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回覆大家的。在此也非常感謝大家對指令碼之家網站的支援!

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/3407/viewspace-2811166/,如需轉載,請註明出處,否則將追究法律責任。

相關文章