多多色-多人伦交性欧美在线观看-多人伦精品一区二区三区视频-多色视频-免费黄色视屏网站-免费黄色在线

國內最全IT社區平臺 聯系我們 | 收藏本站
阿里云優惠2
您當前位置:首頁 > 服務器 > linux安裝mysql 5.6實時教程和配置

linux安裝mysql 5.6實時教程和配置

來源:程序員人生   發布時間:2015-03-18 10:01:07 閱讀次數:3468次

今天數據庫服務器可使用了,現在下1步就是安裝mysql,決定mysql 版本為5.6.14

  1. 檢查系統中是不是已安裝過mysql。
    rpm -qa | grep mysql
    以下圖:

  2. 如果存在,則需要刪除。
    yum -y remove mysql*
  3. 繼續檢查1下是不是還存在mysql
    rpm -qa | grep -i mysql

  4. 然后下1步就是下載rpm包了。需要下載:
    MySQL-client⑸.6.15⑴.el6.x86_64.rpm
    MySQL-devel⑸.6.15⑴.el6.x86_64.rpm
    MySQL-server⑸.6.15⑴.el6.x86_64.rpm

    逐1履行命令:
    wget http://cdn.mysql.com/archives/mysql⑸.6/MySQL-client⑸.6.15⑴.el6.x86_64.rpm
    wget http://cdn.mysql.com/archives/mysql⑸.6/MySQL-devel⑸.6.15⑴.el6.x86_64.rpm
    wget http://cdn.mysql.com/archives/mysql⑸.6/MySQL-server⑸.6.15⑴.el6.x86_64.rpm


  5. 接下來就是安裝了分別順次履行:
    [root@iZ25in7iu0fZ rpm]# rpm -ivh MySQL-server⑸.6.15⑴.el6.x86_64.rpm
    Preparing...                ########################################### [100%]
       1:MySQL-server           ########################################### [100%]
    2015-03-06 08:16:03 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
    2015-03-06 08:16:03 28629 [Note] InnoDB: The InnoDB memory heap is disabled
    2015-03-06 08:16:03 28629 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
    2015-03-06 08:16:03 28629 [Note] InnoDB: Compressed tables use zlib 1.2.3
    2015-03-06 08:16:03 28629 [Note] InnoDB: Using Linux native AIO
    2015-03-06 08:16:03 28629 [Note] InnoDB: Using CPU crc32 instructions
    2015-03-06 08:16:03 28629 [Note] InnoDB: Initializing buffer pool, size = 128.0M
    2015-03-06 08:16:03 28629 [Note] InnoDB: Completed initialization of buffer pool
    2015-03-06 08:16:03 28629 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
    2015-03-06 08:16:03 28629 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
    2015-03-06 08:16:03 28629 [Note] InnoDB: Database physically writes the file full: wait...
    2015-03-06 08:16:03 28629 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
    2015-03-06 08:16:04 28629 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
    2015-03-06 08:16:06 28629 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
    2015-03-06 08:16:06 28629 [Warning] InnoDB: New log files created, LSN=45781
    2015-03-06 08:16:06 28629 [Note] InnoDB: Doublewrite buffer not found: creating new
    2015-03-06 08:16:06 28629 [Note] InnoDB: Doublewrite buffer created
    2015-03-06 08:16:06 28629 [Note] InnoDB: 128 rollback segment(s) are active.
    2015-03-06 08:16:06 28629 [Warning] InnoDB: Creating foreign key constraint system tables.
    2015-03-06 08:16:06 28629 [Note] InnoDB: Foreign key constraint system tables created
    2015-03-06 08:16:06 28629 [Note] InnoDB: Creating tablespace and datafile system tables.
    2015-03-06 08:16:06 28629 [Note] InnoDB: Tablespace and datafile system tables created.
    2015-03-06 08:16:06 28629 [Note] InnoDB: Waiting for purge to start
    2015-03-06 08:16:06 28629 [Note] InnoDB: 5.6.15 started; log sequence number 0
    A random root password has been set. You will find it in '/root/.mysql_secret'.
    2015-03-06 08:16:07 28629 [Note] Binlog end
    2015-03-06 08:16:07 28629 [Note] InnoDB: FTS optimize thread exiting.
    2015-03-06 08:16:07 28629 [Note] InnoDB: Starting shutdown...
    2015-03-06 08:16:08 28629 [Note] InnoDB: Shutdown completed; log sequence number 1625977




    2015-03-06 08:16:08 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
    2015-03-06 08:16:08 28652 [Note] InnoDB: The InnoDB memory heap is disabled
    2015-03-06 08:16:08 28652 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
    2015-03-06 08:16:08 28652 [Note] InnoDB: Compressed tables use zlib 1.2.3
    2015-03-06 08:16:08 28652 [Note] InnoDB: Using Linux native AIO
    2015-03-06 08:16:08 28652 [Note] InnoDB: Using CPU crc32 instructions
    2015-03-06 08:16:08 28652 [Note] InnoDB: Initializing buffer pool, size = 128.0M
    2015-03-06 08:16:08 28652 [Note] InnoDB: Completed initialization of buffer pool
    2015-03-06 08:16:08 28652 [Note] InnoDB: Highest supported file format is Barracuda.
    2015-03-06 08:16:08 28652 [Note] InnoDB: 128 rollback segment(s) are active.
    2015-03-06 08:16:08 28652 [Note] InnoDB: Waiting for purge to start
    2015-03-06 08:16:08 28652 [Note] InnoDB: 5.6.15 started; log sequence number 1625977
    2015-03-06 08:16:08 28652 [Note] Binlog end
    2015-03-06 08:16:08 28652 [Note] InnoDB: FTS optimize thread exiting.
    2015-03-06 08:16:08 28652 [Note] InnoDB: Starting shutdown...
    2015-03-06 08:16:10 28652 [Note] InnoDB: Shutdown completed; log sequence number 1625987



    [root@iZ25in7iu0fZ rpm]# rpm -ivh MySQL-devel⑸.6.15⑴.el6.x86_64.rpm
    Preparing...                ########################################### [100%]
       1:MySQL-devel            ########################################### [100%]
    [root@iZ25in7iu0fZ rpm]# rpm -ivh MySQL-client⑸.6.15⑴.el6.x86_64.rpm
    Preparing...                ########################################### [100%]
       1:MySQL-client           ########################################### [100%]

    修改配置文件位置。
    [root@iZ25in7iu0fZ rpm]# cp /usr/share/mysql/my-default.cnf /etc/my.cnf
  6. 初始化MySQL及設置密碼
    cp /usr/share/mysql/my-default.cnf /etc/my.cnf
    /usr/bin/mysql_install_db
    cat /root/.mysql_secret 
    記錄最后的密碼
    mysql -p ---輸入記錄的密碼,便可登錄mysql。
    set password for 'root'@'localhost' =password('新密碼');
    flush privileges;
    exit
  7. 設置自啟動
    chkconfig mysql on

  8.  MySQL的默許安裝位置

    1 /var/lib/mysql/               #數據庫目錄
    2 /usr/share/mysql              #配置文件目錄
    3 /usr/bin                     #相干命令目錄
    4 /etc/init.d/mysql              #啟動腳本
  9. 修改字符集和數據寄存目錄
    原來配置文件:


    更改以后為:

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


    [client]
    port            = 3306
    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 = 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 = /mnt/data/mysql
    port = 3306
    # server_id = .....
    # socket = .....


    lower_case_table_names=1


    max_connections=1000


    collation_server = utf8_general_ci
    character_set_server = utf8


    # default-character-set=utf8
    # init_connect='SET NAMES utf8'





    # 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]
    default-character-set = utf8

    注意標紅的。


    然后就是修改數據庫的數據目錄:
    vi /etc/init.d/mysql



  10. 重啟數據庫


    service mysql restart

  11. 大功告成。


生活不易,碼農辛苦
如果您覺得本網站對您的學習有所幫助,可以手機掃描二維碼進行捐贈
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
關閉
程序員人生
主站蜘蛛池模板: 国产第4页 | 国产成人乱码一区二区三区在线 | 国产欧美综合在线一区二区三区 | 国产精品所毛片视频 | 日韩欧美久久一区二区 | 欧美在线一级va免费观看 | 高跟鞋性xxxxhd | 亚洲精品美女久久久久 | 国产视频第二页 | 国产成人精品日本亚洲18图 | 日本一级级特黄特色大片 | 一级爱一级做a性视频 | 欧美日韩免费一区二区三区 | 校园春色欧美日韩 | 日韩有码在线视频 | 日本高清另类videohd | 一级毛片免费观看视频 | 武则天级淫片a级中文 | 高清欧美一区二区三区 | 久久久久久毛片免费观看 | 精品国产综合区久久久久久 | 国产精品国产欧美综合一区 | 国产免费一区2区3区4区 | 一级看片免费视频 | 亚洲曰本大成网站mmm | 日本成在线人视频免费视频 | free性德国丰满hd | 日韩精品一区二区三区中文字幕 | 亚洲hd | 亚洲乱码卡三乱码新区 | 国产精品αv在线观看 | 久久综合久久久久 | 自由成熟的性色视频 | 欧美一区二区三区精品影视 | 亚洲精品国产精品国自产观看 | 精品国产第一国产综合精品 | 色自拍偷拍 | 久久国产欧美另类久久久 | 久久77777| 99精品视频在线成人精彩视频 | 性做久久久久久久久 |