mysql 5.7.21 安裝配置方法圖文教程(window)
window環(huán)境安裝mysql5.7.21,具體內(nèi)容如下
1. 從MySQL官網(wǎng)下載免安裝的壓縮包mysql-5.7.21-winx64.zip
2. 解壓到相應的目錄(此處解壓到F:\mysql-5.7.21-winx64)
3. 配置環(huán)境變量,將MySQL的啟動目錄(F:\mysql-5.7.21-winx64\bin)添加到Path中
4. 在MySQL目錄下(F:\mysql-5.7.21-winx64)創(chuàng)建my.ini文件,內(nèi)容如下:
[mysql] # 設置mysql客戶端默認字符集 default-character-set=utf8 [mysqld] #設置3306端口 port = 3306 # 設置mysql的安裝目錄 basedir=F:\mysql-5.7.21-winx64 # 設置mysql數(shù)據(jù)庫的數(shù)據(jù)的存放目錄 datadir=F:\mysql-5.7.21-winx64\data # 允許最大連接數(shù) max_connections=200 # 服務端使用的字符集默認為8比特編碼的latin1字符集 character-set-server=utf8 # 創(chuàng)建新表時將使用的默認存儲引擎 default-storage-engine=INNODB
5. 管理員身份運行cmd
切換目錄:C:\Windows\system32>cd F:\mysql-5.7.21-winx64\bin
生成MySQL服務:
F:\mysql-5.7.21-winx64\bin>mysqld -install Service successfully installed.
生成data目錄:F:\mysql-5.7.21-winx64\bin>mysqld --initialize-insecure --user=mysql
啟動MySQL服務:
C:\Windows\system32>net start mysql MySQL 服務正在啟動 . MySQL 服務已經(jīng)啟動成功。
6. 登錄數(shù)據(jù)庫,修改密碼(默認密碼為空)
登錄數(shù)據(jù)庫:
C:\Windows\system32>mysql -uroot -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> mysql> mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.00 sec) mysql> use mysql; Database changed mysql> update user set authentication_string=password("新密碼") where User="root"; Query OK, 1 row affected, 1 warning (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 1 mysql> mysql>FLUSH PRIVILEGES;
精彩專題分享:mysql不同版本安裝教程 mysql5.7各版本安裝教程
以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。
相關文章
replace MYSQL字符替換函數(shù)sql語句分享(正則判斷)
最近更新網(wǎng)站發(fā)現(xiàn)一些字段的值不是預期的效果,需要替換下值,通過下面的sql語句,直接執(zhí)行就可以了2012-06-06MySql中把一個表的數(shù)據(jù)插入到另一個表中的實現(xiàn)代碼
本篇文章是對MySql中把一個表的數(shù)據(jù)插入到另一個表中的實現(xiàn)代碼進行了詳細的分析介紹,需要的朋友參考下2013-05-05在IntelliJ IDEA中使用Java連接MySQL數(shù)據(jù)庫的方法詳解
這篇文章主要介紹了在IntelliJ IDEA中使用Java連接MySQL數(shù)據(jù)庫的方法詳解,本文通過圖文并茂的形式給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2020-10-10MySQL錯誤代碼:1052?Column?'xxx'?in?field?list?is
今天在工作中寫sql語句時遇到了個sql錯誤,為記錄并不再重復出錯,下面這篇文章主要給大家介紹了關于MySQL錯誤代碼:1052?Column?'xxx'?in?field?list?is?ambiguous的原因和解決方法,需要的朋友可以參考下2023-04-04