安装MySQL

系统 1713 0
  1. 下载zip包
    进入官网下载页面: http://dev.mysql.com/downloads/mysql/
    下载mysql-5.6.23-win32.zip:
    Windows (x86, 32-bit), ZIP Archive 5.6.23 342.3M
    (mysql-5.6.23-win32.zip) MD5:  d55ea458590c92060a790ba22e9b4222  |  Signature
  2. 解压zip包
    解压zip包到E:\develop\database\mysql\
  3. 配置环境变量
    新增MYSQL_HOME变量
              MYSQL_HOME
              
    E:\develop\database\mysql\mysql-5.6.21

    在PATH变量后追加

              ;%MYSQL_HOME%\bin 
            
  4. 修改配置文件
    复制my-default.ini为自己使用的配置文件(如: jian.ini),编辑后最终得jian.ini以下内容:
              
                # For advice on how to change settings please see
    
    # http:
              
              
                //
              
              
                dev.mysql.com/doc/refman/5.6/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.
    
    
    
    [mysql]  
    
    #设置mysql客户端的字符集  
    
    default
              
              -character-set =
              
                 utf8
    
    
    
    [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 
              
              =
              
                 256M
    
    
    
    # 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.
    
    # 设置mysql的安装目录
    
    basedir 
              
              = E:/develop/database/mysql/mysql-
              
                5.6
              
              .
              
                21
              
              
                
    
    # 设置mysql数据库的数据的存放目录
    
    datadir 
              
              = E:/develop/database/mysql/mysql-
              
                5.6
              
              .
              
                21
              
              /
              
                data
    
    # 设置绑定端口
    
    port 
              
              = 
              
                3366
              
              
                
    
    # server_id 
              
              =
              
                 .....
    
    #设置服务器段的字符集  
    
    character_set_server 
              
              =
              
                 utf8
    
    # 允许最大连接数
    
    max_connections 
              
              = 
              
                10
              
              
                
    
    
    
    # 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 
            
  5. 安装
    以管理员身份运行cmd,输入命令:
              mysqld install jianSQLService --defaults-file="E:\develop\database\mysql\mysql-5.6.21\jian.ini"
            
  6. 启动
              
                net
              
              
                start
              
               jianSQLService
            
  7. 登录
              mysql -P3366 -uroot -p
            

    参数说明:
    -h: mysql服务器地址。若本机,可省略;
    -P: mysql服务器端口。若默认3306,可省略;
    -u: 用户名;
    -p: 密码。密码为空,可省略。

  8. 修改root密码
              mysql> update mysql.user 
              
                set
              
               password=password("jian") where User="root";
              
                
    
    Query OK
              
              , 3 rows affected (0.00 sec)
              
                
    
    Rows matched: 
              
              3  Changed: 3  Warnings: 0
              
                
    
    
    
    mysql
              
              > flush privileges;
              
                
    
    Query OK
              
              , 0 rows affected (0.00 sec)
            
  9. 关闭
              
                net
              
               stop jianSQLService
            
  10. 卸载
    慎用
    。在放弃使用MySQL时,才用到此项
    以管理员身份运行cmd,输入命令:
              mysqld –remove
            

    或者

              sc delete jianSQLService
            

     

  11. 参考
    http://supportopensource.iteye.com/blog/1415527

 

安装MySQL


更多文章、技术交流、商务合作、联系博主

微信扫码或搜索:z360901061

微信扫一扫加我为好友

QQ号联系: 360901061

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描下面二维码支持博主2元、5元、10元、20元等您想捐的金额吧,狠狠点击下面给点支持吧,站长非常感激您!手机微信长按不能支付解决办法:请将微信支付二维码保存到相册,切换到微信,然后点击微信右上角扫一扫功能,选择支付二维码完成支付。

【本文对您有帮助就好】

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描上面二维码支持博主2元、5元、10元、自定义金额等您想捐的金额吧,站长会非常 感谢您的哦!!!

发表我的评论
最新评论 总共0条评论