數據庫概述、mysql-5.7.11-winx64.zip 的下載、安裝、配置和使用(windows里安裝)圖文詳解


本博文的主要內容有

  .數據庫的概述

  .mysql-5.7.11-winx64.zip 的下載

    .mysql-5.7.11-winx64.zip 的安裝

  .mysql-5.7.11-winx64.zip 的配置

  .mysql-5.7.11-winx64.zip 的使用

 

 

 

 

推薦以下方式來安裝mysql

MySQL Server類型之MySQL客戶端工具的下載、安裝和使用(博主推薦)

 

 

 

 

1、數據庫的概述

 

 

 

 前言

  想說的是,有mysql一定基礎的人員,學大數據里的hive、hbase更是可貴!

2、mysql-5.7.11-winx64.zip 的下載

    http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.11-winx64.zip

 
可以從以下網址,找到所有的MySQL的歷史版本
https://downloads.mysql.com/archives/community/


 






 




3、mysql-5.7.11-winx64.zip 的安裝和配置

   1、 解壓縮zip包

 

  這里想說的是,我們都知道,關於軟件的安裝,有兩種,msi方式和壓縮包解壓安裝。

關於msi的安裝方式,我這里便不多贅述了,見

     http://jingyan.baidu.com/article/7e440953d6f0702fc1e2ef61.html

  

  壓縮包解壓方式的安裝:

         然后,在這一步有資料說,修改默認配置文件my-default.ini。這里啊,我呢。一般為了專業規范起見,將默認的my-default.ini修改命名為my.ini(這一點,是模仿hadoop/spark)里的配置文件設法。

          2、             變成         

# 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 = .....

# datadir = .....

# 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

 

 

  3、做如下的修改

# 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 = D:\SoftWare\MySQL\mysql-5.7.11-winx64
datadir = D:\SoftWare\MySQL\mysql-5.7.11-winx64\Data
port = 3306
# 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

 

 

4、配置環境變量

         新建,MYSQL_HOME,

         在windows的path里,添加如下

                   ;%MYSQL_HOME\bin;(注意加分號)

 

5、將mysql注冊為windows系統服務,即初始化mysql

具體操作是在命令行中執行以下命令(需要以管理員身份運行命令行):

    以下命令是在dos命令行中進行的

需要切換到mysq安裝的bin目錄,

否則,會將服務目錄指定為C:\Program Files\MySQL\MySQL Server 5.7\mysqld

         這里,順便,學些dos窗口里的一些常用命令吧!

以管理員的身份進行運行,

C:\Users\Administrator>cd /d D:\

D:\>cd D:\SoftWare\MySQL\mysql-5.7.11-winx64

D:\SoftWare\MySQL\mysql-5.7.11-winx64>cd bin

D:\SoftWare\MySQL\mysql-5.7.11-winx64\bin>

 

  6、自己新建好Data目錄

 

   

  7、執行mysqld.exe --initialize 命令,

  D:\SoftWare\MySQL\mysql-5.7.11-winx64\bin>mysqld --initialize

  回車

  

    

 

  8、執行 mysqld -install命令

  D:\SoftWare\MySQL\mysql-5.7.11-winx64\bin > mysqld install

或者

  D:\SoftWare\MySQL\mysql-5.7.11-winx64\bin >

        mysqld install MySQL --defaults-file=

                                                          " D:\SoftWare\MySQL\mysql-5.7.11-winx64\bin\my.ini"

   

或者

   

     顯示Service successfully installed.表示初始化成功!

 

 

  9、執行mysqld.exe -nt --skip-grant-tables

            

注意:窗口無反應

 

 

 

  10、重新打開dos窗口,執行mysql -u root

 

 

 

  11、執行mysql -u root

mysql> use mysql

 Database changed

 mysql> update user set authtication_string=Password('rootroot') where user='root'

        -> set password=Password('rootroot')

        ->

 

 

  12、在任務管理器中終止mysqld進程,

 

 

 

 

  13、開啟mysql服務。

D:\SoftWare\MySQL\mysql-5.7.11-winx64\bin> net start mysql

安裝完成。

 

 

 

5、mysql-5.7.11-winx64.zip 的使用

以后,每次,都是到bin

 

 

  感謝如下的鏈接博主:

  http://www.cnblogs.com/endv/p/5205435.html   

 

 

總結:

  對於windows里安裝Mysql,會出現各種問題,在此,我也是在這基礎上,得到了認識和提升!!!

  問題:

解決辦法1:

mysqld –remove MySQL

 

 

【轉】終於知道為什么我的mysql總是卸載的不干凈以及老是找不到my.ini文件

http://blog.sina.com.cn/s/blog_6fc5bfa90100qmr9.html 

http://www.cnblogs.com/zlslch/p/5862100.html 

 

 

 

推薦書籍:

 

 

 

 

 

 

 

 

 

 

 

歡迎大家,加入我的微信公眾號:大數據躺過的坑     免費給分享
 
 
 

同時,大家可以關注我的個人博客

   http://www.cnblogs.com/zlslch/   和  http://www.cnblogs.com/lchzls/ 

 

  人生苦短,我願分享。本公眾號將秉持活到老學到老學習無休止的交流分享開源精神,匯聚於互聯網和個人學習工作的精華干貨知識,一切來於互聯網,反饋回互聯網。
  目前研究領域:大數據、機器學習、深度學習、人工智能、數據挖掘、數據分析。 語言涉及:Java、Scala、Python、Shell、Linux等 。同時還涉及平常所使用的手機、電腦和互聯網上的使用技巧、問題和實用軟件。 只要你一直關注和呆在群里,每天必須有收獲

 

       以及對應本平台的QQ群:161156071(大數據躺過的坑)

 

 

 

 

 

 

 

 

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM