window環(huán)境配置Mysql 5.7.21 windowx64.zip免安裝版教程詳解
1.從官網(wǎng)下載mysql-5.7.21-windowx64.zip mysql下載頁面
2.解壓到合適的位置(E:\mysql) 這名字是我改過的
3.配置環(huán)境變量,將E:\mysql\bin 添加到PATH中
4.在mysql目錄下(E:\mysql) 創(chuàng)建 my.ini文件,內(nèi)容如下:
[mysql] # 設(shè)置mysql客戶端默認(rèn)字符集 default-character-set=utf8 [mysqld] #設(shè)置3306端口 port = 3306 # 設(shè)置mysql的安裝目錄 basedir=E:\mysql # 設(shè)置mysql數(shù)據(jù)庫(kù)的數(shù)據(jù)的存放目錄 datadir=E:\mysql\data # 允許最大連接數(shù) max_connections=200 # 服務(wù)端使用的字符集默認(rèn)為8比特編碼的latin1字符集 character-set-server=utf8 # 創(chuàng)建新表時(shí)將使用的默認(rèn)存儲(chǔ)引擎 default-storage-engine=INNODB "#"為注釋
5.管理員身份運(yùn)行cmd
切換目錄 cd E:\mysql\bin
生成mysql服務(wù)(就是安裝my.ini文件)
E:\mysql\bin> mysqld -install; Service successfully installed.
生成data目錄 E:\mysql\bin> mysqld --initialize-insecure --user=mysql
;
這里生成失敗的話看下面
E:\mysql\bin>cd ../ E:\mysql> mysqld --initialize-insecure --user=mysql ;
啟動(dòng)mysql服務(wù)
E:\mysql\bin> net start mysql;
MySQL 服務(wù)正在啟動(dòng) .
MySQL 服務(wù)已經(jīng)啟動(dòng)成功。
6.登錄數(shù)據(jù)庫(kù),修改密碼(默認(rèn)為空)
E:\mysql\bin> mysql -u root -p; Enter password: //這里直接回車 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.7.21 MySQL Community Server (GPL) Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
修改密碼
mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.00 sec) mysql> use mysql; Database changed mysql> set password for 'root'@'localhost'=password('新密碼'); mysql> flush privileges;
退出測(cè)試是否成功
mysql> quit; E:\mysql\bin> mysql -u root -p; Enter password:
注釋:
在mysql中一條語句結(jié)束加;號(hào)
開始mysql服務(wù)net start mysql;
停止mysql服務(wù)net stop mysql;
生成服務(wù)mysqld -install;
刪除服務(wù)mysqld -remove;
登錄數(shù)據(jù)庫(kù)mysql -u root -p;
退出mysql> quit;
總結(jié)
以上所述是小編給大家介紹的window環(huán)境配置Mysql 5.7.21 windowx64.zip免安裝版教程詳解,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
相關(guān)文章
基于C++實(shí)現(xiàn)Mysql數(shù)據(jù)庫(kù)連接池實(shí)例
數(shù)據(jù)庫(kù)連接池負(fù)責(zé)分配、管理、和釋放數(shù)據(jù)庫(kù)連接,允許使用應(yīng)用程序重復(fù)使用一個(gè)現(xiàn)有的數(shù)據(jù)庫(kù)連接。數(shù)據(jù)庫(kù)連接是關(guān)鍵有限且昂貴的資源,一個(gè)數(shù)據(jù)庫(kù)連接對(duì)象均對(duì)應(yīng)一個(gè)物理數(shù)據(jù)庫(kù)的連接,每次操作都打開一個(gè)物理連接,使用完都關(guān)閉連接2022-12-12MySQL的match函數(shù)在sp中使用BUG解決分析
這篇文章主要為大家介紹了MySQL的match函數(shù)在sp中使用BUG解決分析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-07-07mysql隨機(jī)查詢10條數(shù)據(jù)的三種方法
本文主要介紹了mysql隨機(jī)查詢10條數(shù)據(jù)的三種方法,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2023-09-09linux mysql 數(shù)據(jù)庫(kù)開啟外部訪問設(shè)置指南
Linux下設(shè)置MySQL和允許外部機(jī)器訪問,具體目錄是具體情況而定,有的人是安裝了在個(gè)人目錄下,則找到對(duì)應(yīng)的目錄則可以2012-11-11mysql 某字段插入隨機(jī)數(shù)(插入隨機(jī)數(shù)到MySQL數(shù)據(jù)庫(kù))
這篇文章主要介紹了mysql 某字段插入隨機(jī)數(shù)(插入隨機(jī)數(shù)到MySQL數(shù)據(jù)庫(kù)),需要的朋友可以參考下2016-09-09