mysql 5.6.26 winx64安裝配置圖文教程(一)
閱讀目錄
• 下載MySQL免安裝版
• 配置MySQL數(shù)據(jù)庫(kù)
• MySQL環(huán)境變量
• 安裝MySQL數(shù)據(jù)庫(kù)
公司服務(wù)器是Windows 開(kāi)發(fā)連接的數(shù)據(jù)庫(kù)使用的是"MySQL"
此篇隨筆將介紹在Windows上如何配置MySQL數(shù)據(jù)庫(kù)免安裝版
一、下載MySQL免安裝版
• 首先進(jìn)入MySQL 官方網(wǎng)站 www.mysql.com -->Downloads(下載) --> Community(社區(qū)) --> MySQL Community Server(MySQL社區(qū)服務(wù)器)-->選擇操作系統(tǒng)平臺(tái)(Windows)
• 下面有三個(gè)可選的下載文件
† 第一個(gè)是MySQL Installer 5.6 for Windows,下載下來(lái)是一個(gè).msi可執(zhí)行安裝文件
† 后面兩個(gè)是解壓版(Zip版)分別是Windows (x86, 64-bit) ZIP Archive 和 Windows (x86, 32-bit), ZIP Archive
• 筆者選擇的是 mysql-5.6.26-winx64.zip ,因?yàn)楣P者的服務(wù)器版本是64位操作系統(tǒng)
二、配置MySQL數(shù)據(jù)庫(kù)
• 將下載的 mysql-5.6.26-winx64.zip 解壓自定義目錄,這里筆者將把這個(gè)壓縮包解壓至 D:\mysql-5_x64 目錄;
• 打開(kāi)這個(gè)目錄,發(fā)現(xiàn)里面的文件夾和文件跟一個(gè)安裝好后的MySQL基本沒(méi)有區(qū)別
• 修改MySQL配置文件,在mysql-5_x64目錄下有一個(gè)my-default.ini,可以算作模板來(lái)使用,里面的內(nèi)容不是很多!可以自己創(chuàng)建一個(gè) my.ini作為MySQL配置文件,打開(kāi)my.ini
[client]
port=3306
#客戶(hù)端字符類(lèi)型,與服務(wù)端一致就行,建議utf8
default-character-set=utf8
[mysqld]
#綁定IPv4和3306端口
bind-address = 0.0.0.0
port = 3306
#服務(wù)端字符類(lèi)型,建議utf8
character_set_server=utf8
# 設(shè)置mysql的安裝目錄
basedir=D:/mysql-5_x64
# 設(shè)置mysql數(shù)據(jù)庫(kù)的數(shù)據(jù)的存放目錄
datadir=D:/mysql-5_x64/data
# 允許最大連接數(shù)
max_connections=201
• 這樣一個(gè)基本的MySQL環(huán)境所需要的參數(shù)就夠了
三、MySQL環(huán)境變量
• 右擊這臺(tái)電腦-->屬性-->高級(jí)-->環(huán)境變量-->"用戶(hù)變量"新建變量MYSQL_HOME 值D:\mysql-5_x64 ,"系統(tǒng)變量"找到變量path 編輯 在后面加上 ;%MYSQL_HOME%\bin
四、安裝MySQL數(shù)據(jù)庫(kù)
• 運(yùn)行cmd (Win8 、Win10以管理員運(yùn)行cmd)-->進(jìn)入D:\mysql-5_x64\bin目錄
Microsoft Windows [版本 10.0.10240]
(c) 2015 Microsoft Corporation. All rights reserved.
C:\Windows\system32>D:
D:\>cd mysql-5_x64
D:\mysql-5_x64>cd bin
D:\mysql-5_x64\bin>
• 執(zhí)行mysqld -install 安裝MySQL
D:\mysql-5_x64\bin>mysqld -install
Service successfully installed
• 執(zhí)行net start mysql啟動(dòng)MySQL
D:\mysql-5_x64\bin>net start mysql
D:\mysql-5_x64\bin>net start mysql
MySQL 服務(wù)正在啟動(dòng) .
MySQL 服務(wù)已經(jīng)啟動(dòng)成功
啟動(dòng)MySQL服務(wù):net start mysql
停止MySQL服務(wù):net stop mysql
刪除MySQL服務(wù):sc delete mysql
• 修改Mysql密碼
D:\mysql-5_x64\bin>mysql -u root -p //使用root登入mysql
Enter password: //密碼空,回車(chē)即可
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.26 MySQL Community Server (GPL)
Copyright (c) 2000, 2015, 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; //顯示所有數(shù)據(jù)庫(kù) +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | test | +--------------------+ 4 rows in set (0.00 sec)
• 進(jìn)入'mysql'數(shù)據(jù)、刪除空用戶(hù)
mysql> use mysql; Database changed mysql> delete from user where user=''; Query OK, 1 row affected (0.00 sec)
• 更新密碼并重新刷權(quán)限表到內(nèi)存(也可以用mysqladmin工具來(lái)設(shè)置密碼)
mysql> update User set Password=PASSWORD('123456') where User='root'; Query OK, 4 rows affected (0.00 sec) Rows matched: 4 Changed: 4 Warnings: 0 mysql> flush privileges; Query OK, 0 rows affected (0.00 sec)
• 嘗試登陸
D:\mysql-5_x64\bin>mysql -u root -p //用root用戶(hù)登入數(shù)據(jù)庫(kù) Enter password: ****** //輸入更新后的密碼 123456 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.6.26 MySQL Community Server (GPL) Copyright (c) 2000, 2015, 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>
• 開(kāi)啟遠(yuǎn)程連接(給予全部權(quán)限,允許 192.168.1.x 網(wǎng)段都可以連接)
mysql> grant all privileges on *.* to 'root'@'192.168.1.%' identified by 'root' with grant option; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> select host,user,password from user; +-------------+------+-------------------------------------------+ | host | user | password | +-------------+------+-------------------------------------------+ | 192.168.1.% | root | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B | +-------------+------+-------------------------------------------+ 4 rows in set (0.00 sec)
精彩專(zhuān)題分享:
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
mysql時(shí)間格式和Java時(shí)間格式的對(duì)應(yīng)方式
這篇文章主要介紹了mysql時(shí)間格式和Java時(shí)間格式的對(duì)應(yīng)方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-08-08mybatis+mysql 使用存儲(chǔ)過(guò)程生成流水號(hào)的實(shí)現(xiàn)代碼
這篇文章主要介紹了mybatis+mysql 使用存儲(chǔ)過(guò)程生成流水號(hào)的實(shí)現(xiàn)代碼,需要的朋友可以參考下2018-01-01MySQL中的基本查詢(xún)語(yǔ)句學(xué)習(xí)筆記
這篇文章主要介紹了MySQL中的基本查詢(xún)語(yǔ)句學(xué)習(xí)筆記,包括使用limit限制查詢(xún)結(jié)果條數(shù)和合并查詢(xún)結(jié)果的方法,需要的朋友可以參考下2016-03-03MySQL存儲(chǔ)引擎中的MyISAM和InnoDB區(qū)別詳解
這篇文章主要介紹了MySQL存儲(chǔ)引擎中的MyISAM和InnoDB區(qū)別詳解,本文總結(jié)了MyISAM與InnoDB的11點(diǎn)區(qū)別,需要的朋友可以參考下2015-03-03MySQL系列之redo log、undo log和binlog詳解
這篇文章主要介紹了MySQL系列之redo log、undo log和binlog詳解,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-12-12MySQL數(shù)據(jù)庫(kù)?觸發(fā)器?trigger
這篇文章主要介紹了MySQL數(shù)據(jù)庫(kù)?觸發(fā)器?trigger,觸發(fā)器是一種特殊類(lèi)型的存儲(chǔ)過(guò)程,觸發(fā)器通過(guò)事件進(jìn)行觸發(fā)而被執(zhí)行,可通過(guò)數(shù)據(jù)庫(kù)中的相關(guān)表實(shí)現(xiàn)級(jí)聯(lián)更改,保證數(shù)據(jù)安全,進(jìn)行安全校驗(yàn)2022-06-06深入理解Mysql事務(wù)隔離級(jí)別與鎖機(jī)制問(wèn)題
MySQL默認(rèn)的事務(wù)隔離級(jí)別是可重復(fù)讀,用Spring開(kāi)發(fā)程序時(shí),如果不設(shè)置隔離級(jí)別默認(rèn)用MySQL設(shè)置的隔離級(jí)別,如果Spring設(shè)置了就用已設(shè)置的隔離級(jí)別,本文重點(diǎn)給大家介紹Mysql事務(wù)隔離級(jí)別與鎖機(jī)制的相關(guān)知識(shí),一起看看吧2021-09-09解析mysql中如何獲得數(shù)據(jù)庫(kù)的大小
本篇文章是對(duì)mysql中如何獲得數(shù)據(jù)庫(kù)的大小的解決方法進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下2013-06-06