1. 背景
創(chuàng)新互聯(lián)是一家專業(yè)從事成都網(wǎng)站設(shè)計(jì)、做網(wǎng)站、網(wǎng)頁設(shè)計(jì)的品牌網(wǎng)絡(luò)公司。如今是成都地區(qū)具影響力的網(wǎng)站設(shè)計(jì)公司,作為專業(yè)的成都網(wǎng)站建設(shè)公司,創(chuàng)新互聯(lián)依托強(qiáng)大的技術(shù)實(shí)力、以及多年的網(wǎng)站運(yùn)營經(jīng)驗(yàn),為您提供專業(yè)的成都網(wǎng)站建設(shè)、營銷型網(wǎng)站建設(shè)及網(wǎng)站設(shè)計(jì)開發(fā)服務(wù)!* MySQL是一個(gè)關(guān)系型數(shù)據(jù)庫管理系統(tǒng),由瑞典MySQL AB 公司開發(fā),目前屬于 Oracle 旗下產(chǎn)品。MySQL 是最流行的關(guān)系型數(shù)據(jù)庫管理系統(tǒng)之一,在 WEB 應(yīng)用方面,MySQL是最好的 RDBMS (Relational Database Management System,關(guān)系數(shù)據(jù)庫管理系統(tǒng)) 應(yīng)用軟件。
* MySQL是一種關(guān)系數(shù)據(jù)庫管理系統(tǒng),關(guān)系數(shù)據(jù)庫將數(shù)據(jù)保存在不同的表中,而不是將所有數(shù)據(jù)放在一個(gè)大倉庫內(nèi),這樣就增加了速度并提高了靈活性。
* MySQL所使用的 SQL 語言是用于訪問數(shù)據(jù)庫的最常用標(biāo)準(zhǔn)化語言。MySQL 軟件采用了雙授權(quán)政策,分為社區(qū)版和商業(yè)版,由于其體積小、速度快、總體擁有成本低,尤其是開放源碼這一特點(diǎn),一般中小型網(wǎng)站的開發(fā)都選擇 MySQL 作為網(wǎng)站數(shù)據(jù)庫。
2. 選擇的理由
* 支持多種平臺[AIX、FreeBSD、HP-UX、Linux、Mac OS、OpenBSD、Solaris、Windows......]
* 支持并提供多語言API
* 開源,采用了 GPL協(xié)議,可以修改源碼來開發(fā)自己的 MySQL 系統(tǒng)
* 支持標(biāo)準(zhǔn)SQL語句
* 支持多種存儲引擎
* 使用廣泛 [ 全球top20網(wǎng)站除微軟的Live和Bing之外全部應(yīng)用MySQL ]
3. MySQL安裝方式
* 二制包安裝
* 源碼編譯安裝
* 平臺安裝包,如rpm包[centos,redhat]或deb[debian,ubuntu]包
4. 環(huán)境 [關(guān)閉selinux]
[root@MySQL ~]# cat /etc/redhat-release CentOS release 6.9 (Final) [root@MySQL ~]# uname -r 2.6.32-642.3.1.el6.x86_64 [root@MySQL ~]# getenforce Disabled5. 安裝
* 下載MySQL5.6二進(jìn)制包 [ 推薦從MySQL官方下載 ]
[root@MySQL ~]# wget https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz* 解壓MySQL二進(jìn)制包
[root@MySQL ~]# tar zxvf mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz* 移動MySQL二進(jìn)制包
[root@MySQL ~]# mv mysql-5.6.36-linux-glibc2.5-x86_64 /usr/local/* 創(chuàng)建軟鏈接
[root@MySQL ~]# ln -s /usr/local/mysql-5.6.36-linux-glibc2.5-x86_64 /usr/local/mysql* 創(chuàng)建 mysql 用戶
[root@MySQL ~]# useradd -r -s /sbin/nologin mysql* 創(chuàng)建mysql數(shù)據(jù)庫文件存放目錄
[root@MySQL ~]# mkdir -p /data/mysql_data* 修改二進(jìn)制包目錄與數(shù)據(jù)目錄所屬用戶與所屬用戶組
[root@MySQL ~]# chown mysql.mysql -R /usr/local/mysql-5.6.36-linux-glibc2.5-x86_64 /data/mysql_data* 復(fù)制默認(rèn)配置文件至/etc/my.cnf
[root@MySQL ~]# cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf* MySQL初始化 [ 創(chuàng)建數(shù)據(jù)庫相關(guān)文件 ] 看到兩個(gè)OK并沒有ERROR錯(cuò)誤信息表明初始化成功
[root@MySQL ~]# /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql_data WARNING: The host 'MySQL' could not be looked up with /usr/local/mysql/bin/resolveip. This probably means that your libc libraries are not 100 % compatible with this binary MySQL version. The MySQL daemon, mysqld, should work normally with the exception that host name resolving will not work. This means that you should use IP addresses instead of hostnames when specifying MySQL privileges ! Installing MySQL system tables...2017-06-24 03:57:47 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2017-06-24 03:57:47 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap. 2017-06-24 03:57:47 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.6.36) starting as process 20685 ... 2017-06-24 03:57:47 20685 [Note] InnoDB: Using atomics to ref count buffer pool pages 2017-06-24 03:57:47 20685 [Note] InnoDB: The InnoDB memory heap is disabled 2017-06-24 03:57:47 20685 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2017-06-24 03:57:47 20685 [Note] InnoDB: Memory barrier is not used 2017-06-24 03:57:47 20685 [Note] InnoDB: Compressed tables use zlib 1.2.3 2017-06-24 03:57:47 20685 [Note] InnoDB: Using Linux native AIO 2017-06-24 03:57:47 20685 [Note] InnoDB: Using CPU crc32 instructions 2017-06-24 03:57:47 20685 [Note] InnoDB: Initializing buffer pool, size = 128.0M 2017-06-24 03:57:47 20685 [Note] InnoDB: Completed initialization of buffer pool 2017-06-24 03:57:47 20685 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created! 2017-06-24 03:57:47 20685 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB 2017-06-24 03:57:47 20685 [Note] InnoDB: Database physically writes the file full: wait... 2017-06-24 03:57:47 20685 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB 2017-06-24 03:57:49 20685 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB 2017-06-24 03:57:51 20685 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0 2017-06-24 03:57:51 20685 [Warning] InnoDB: New log files created, LSN=45781 2017-06-24 03:57:51 20685 [Note] InnoDB: Doublewrite buffer not found: creating new 2017-06-24 03:57:51 20685 [Note] InnoDB: Doublewrite buffer created 2017-06-24 03:57:51 20685 [Note] InnoDB: 128 rollback segment(s) are active. 2017-06-24 03:57:51 20685 [Warning] InnoDB: Creating foreign key constraint system tables. 2017-06-24 03:57:51 20685 [Note] InnoDB: Foreign key constraint system tables created 2017-06-24 03:57:51 20685 [Note] InnoDB: Creating tablespace and datafile system tables. 2017-06-24 03:57:51 20685 [Note] InnoDB: Tablespace and datafile system tables created. 2017-06-24 03:57:51 20685 [Note] InnoDB: Waiting for purge to start 2017-06-24 03:57:52 20685 [Note] InnoDB: 5.6.36 started; log sequence number 0 2017-06-24 03:57:58 20685 [Note] Binlog end 2017-06-24 03:57:58 20685 [Note] InnoDB: FTS optimize thread exiting. 2017-06-24 03:57:58 20685 [Note] InnoDB: Starting shutdown... 2017-06-24 03:58:00 20685 [Note] InnoDB: Shutdown completed; log sequence number 1625977 OK Filling help tables...2017-06-24 03:58:00 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2017-06-24 03:58:00 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap. 2017-06-24 03:58:00 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.6.36) starting as process 20731 ... 2017-06-24 03:58:00 20731 [Note] InnoDB: Using atomics to ref count buffer pool pages 2017-06-24 03:58:00 20731 [Note] InnoDB: The InnoDB memory heap is disabled 2017-06-24 03:58:00 20731 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2017-06-24 03:58:00 20731 [Note] InnoDB: Memory barrier is not used 2017-06-24 03:58:00 20731 [Note] InnoDB: Compressed tables use zlib 1.2.3 2017-06-24 03:58:00 20731 [Note] InnoDB: Using Linux native AIO 2017-06-24 03:58:00 20731 [Note] InnoDB: Using CPU crc32 instructions 2017-06-24 03:58:00 20731 [Note] InnoDB: Initializing buffer pool, size = 128.0M 2017-06-24 03:58:00 20731 [Note] InnoDB: Completed initialization of buffer pool 2017-06-24 03:58:00 20731 [Note] InnoDB: Highest supported file format is Barracuda. 2017-06-24 03:58:00 20731 [Note] InnoDB: 128 rollback segment(s) are active. 2017-06-24 03:58:00 20731 [Note] InnoDB: Waiting for purge to start 2017-06-24 03:58:00 20731 [Note] InnoDB: 5.6.36 started; log sequence number 1625977 2017-06-24 03:58:00 20731 [Note] Binlog end 2017-06-24 03:58:00 20731 [Note] InnoDB: FTS optimize thread exiting. 2017-06-24 03:58:00 20731 [Note] InnoDB: Starting shutdown... 2017-06-24 03:58:02 20731 [Note] InnoDB: Shutdown completed; log sequence number 1625987 OK6. 創(chuàng)建啟動腳本
* 復(fù)制啟動腳本到service 服務(wù)管理目錄下[ /etc/init.d ]
[root@MySQL ~]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld* 修改mysql啟動腳本 [ /et/init.d/mysqld ]
basedir=/usr/local/mysql datadir=/data/mysql_data* 添加腳本執(zhí)行權(quán)限
[root@MySQL ~]# chmod +x /etc/init.d/mysqld* 添加進(jìn)service服務(wù)管理
[root@MySQL ~]# chkconfig --add mysqld7. 服務(wù)啟動測試
* 啟動 MySQL 服務(wù)
[root@MySQL ~]# /etc/init.d/mysqld start Starting MySQL.Logging to '/data/mysql_data/MySQL.err'. SUCCESS!* 查看服務(wù)是否啟動并監(jiān)聽端口 [默認(rèn)3306]
[root@MySQL ~]# netstat -lntp | grep 3306 tcp 0 0 :::3306 :::* LISTEN 21366/mysqld8. 連接測試并修改密碼
* 通過自帶mysql客戶端連接
[root@MySQL ~]# /usr/local/mysql/bin/mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.6.36 MySQL Community Server (GPL) Copyright (c) 2000, 2017, 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> set password = password('123456'); Query OK, 0 rows affected (0.00 sec)* 重新使用密碼連接
mysql> quit Bye [root@MySQL ~]# /usr/local/mysql/bin/mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) [root@MySQL ~]# /usr/local/mysql/bin/mysql -p123456 Warning: Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.6.36 MySQL Community Server (GPL) Copyright (c) 2000, 2017, 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>9. 總結(jié)
以需求驅(qū)動技術(shù),技術(shù)本身沒有優(yōu)略之分,只有業(yè)務(wù)之分。
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
本文標(biāo)題:MySQL5.6--------基于CentOS6二進(jìn)制包安裝-創(chuàng)新互聯(lián)
網(wǎng)頁地址:http://www.rwnh.cn/article14/dghgde.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站策劃、動態(tài)網(wǎng)站、搜索引擎優(yōu)化、標(biāo)簽優(yōu)化、用戶體驗(yàn)、自適應(yīng)網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容