欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

mysql5.7.13 環(huán)境搭建教程(解壓縮版)

 更新時(shí)間:2016年07月20日 08:51:56   作者:Bigdots  
這篇文章主要為大家詳細(xì)介紹了mysql解壓縮版環(huán)境搭建教程,具有一定的實(shí)用性,感興趣的小伙伴們可以參考一下

最近決定學(xué)習(xí)數(shù)據(jù)庫(kù),在比較了各個(gè)數(shù)據(jù)庫(kù)之后,選擇從mysql入手,主要原因:
 •開(kāi)源
 •成熟,通用
 •用戶量多,社區(qū)完善
 •入門(mén)簡(jiǎn)單

一、下載安裝
 mysql的官網(wǎng)下載地址:http://dev.mysql.com/downloads/mysql/
 mysql官網(wǎng)有倆種版本可供下載,分別是客戶端版本(Recommended Download,也是官網(wǎng)的推薦版本)和解壓縮版本(Archive)。我這里選擇的是解壓縮版本,點(diǎn)擊download進(jìn)行下載,下載完畢后直接將壓縮包解壓到您想要安裝mysql的目標(biāo)路徑即可。
我下載的是5.7.13版本,解壓后,得到一個(gè)mysql-5.7.13-winx64的文件夾,它包含如下文件:
2016/07/18  14:34    <DIR>          .
2016/07/18  14:34    <DIR>          ..
2016/07/18  14:34    <DIR>          bin
2016/05/25  13:50            17,987 COPYING
2016/07/18  14:34    <DIR>          docs
2016/07/18  14:33    <DIR>          include
2016/07/18  14:34    <DIR>          lib
2016/05/25  14:08             1,141 my-default.ini
2016/05/25  13:50             2,478 README
2016/07/18  14:34    <DIR>          share
               3 個(gè)文件         21,606 字節(jié)
               7 個(gè)目錄 118,994,726,912 可用字節(jié)
至此,下載安裝完畢 

二、配置mysql 

1.配置my.ini
我這里將mysql-5.7.13-winx64文件重命名為mysql(原文件名太長(zhǎng)了),該文件下的my-default.ini是默認(rèn)的配置文件,我們這里需要自己重新實(shí)現(xiàn)配置:將my-default.ini復(fù)制一份并重命名為my.ini,并將最將basedir、datadir等參數(shù)的文件目錄替換成你自己mysql所在目錄的路徑。

 # 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]

# 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 = C:\mysql
datadir = C:\mysql\data
# port = .....
# server_id = .....


# 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 

我這里的mysql文件放在c盤(pán)下,所以只要把上面文件中“c:/mysql”的地方填入你自己的文件路徑就ok了。 

2.配置環(huán)境變量
將你的mysql bin文件夾的路徑添加到PATH中,很簡(jiǎn)單,不多說(shuō)了。

三、運(yùn)行mysql
以管理員身份運(yùn)行cmd(一定要用管理員身份運(yùn)行),并進(jìn)入到mysql的bin文件中
mysqld --remove
mysqld --install
mysqld --initialize //會(huì)生成一個(gè)data文件夾
net start mysql //啟動(dòng)mysql服務(wù)
依次執(zhí)行這三個(gè)命令后,打開(kāi)data文件夾,找到其下error文件類(lèi)型的文件打開(kāi),該文件是本次mysql初始化的log日志,包括初始化密碼。如果顯示“root@localhost is created with an empty password !”,則為空。然后執(zhí)行
 mysql -uroot -p
輸入用戶名和密碼,顯示“ Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. ”,則表示連接成功。 

四、登錄出錯(cuò)
 
如果登錄的時(shí)候存在問(wèn)題,顯示“ Access denied for user 'root'@'localhost'”,可以嘗試重新設(shè)置設(shè)置root密碼:
 1.修改/my.ini文件,在[mysqld]下添加 skip-grant-tables , 再啟動(dòng)mysql

 2.然后用空密碼方式使用root用戶登錄 MySQL;
 mysql -u root

 3.修改root用戶的密碼;

 mysql> update mysql.user set password=PASSWORD('新密碼') where User='root'
mysql> flush privileges;
mysql> quit

 4.重新啟動(dòng)MySQL,就可以使用新密碼登錄了。

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論