您好,登錄后才能下訂單哦!
下文給大家?guī)碛嘘P(guān)實(shí)戰(zhàn)解決MySQL5.7版編譯安裝問題內(nèi)容,相信大家一定看過類似的文章。我們給大家?guī)淼挠泻尾煌??一起來看看正文部分吧,相信看完?shí)戰(zhàn)解決MySQL5.7版編譯安裝問題你一定會(huì)有所收獲。
自20世紀(jì)60年代起,第一代數(shù)據(jù)庫系統(tǒng)問世。它們是層次模型與網(wǎng)狀模型的數(shù)據(jù)庫系統(tǒng),為統(tǒng)一管理和共享數(shù)據(jù)提供了有力的支撐
關(guān)系數(shù)據(jù)庫系統(tǒng)是基于關(guān)系模型的數(shù)據(jù)庫系統(tǒng),它的基本概念來自于關(guān)系模型
關(guān)系模型建立在關(guān)系代數(shù)的理論基礎(chǔ)上,數(shù)據(jù)結(jié)構(gòu)使用簡(jiǎn)單易懂的二維數(shù)據(jù)表,可以用簡(jiǎn)單的“實(shí)體-關(guān)系”(E-R)圖來直接表示
E-R圖中包含了實(shí)體(數(shù)據(jù)對(duì)象)、關(guān)系和屬性三個(gè)要素
所有實(shí)體及實(shí)體之間聯(lián)系的集合構(gòu)成一個(gè)關(guān)系數(shù)據(jù)庫
關(guān)系數(shù)據(jù)庫的存儲(chǔ)結(jié)構(gòu)是二維表格,反映事物及其聯(lián)系的數(shù)據(jù)是以表格形式保存的
也稱為實(shí)例,對(duì)應(yīng)現(xiàn)實(shí)世界中可區(qū)別于其他對(duì)象的"事件”或事物”,如銀行客戶、銀行賬戶等
實(shí)體所具有的某一特性,一個(gè)實(shí)體可以有多個(gè)屬性。例如,“銀行客戶”實(shí)體集中的每個(gè)實(shí)體均具有姓名、住址、電話等屬性
實(shí)體集之間的對(duì)應(yīng)關(guān)系稱為聯(lián)系,也稱為關(guān)系。例如,銀行客戶和銀行賬戶之間存在“儲(chǔ)蓄”的關(guān)系
1、非關(guān)系數(shù)據(jù)庫也被稱作NoSQL(Not Only SQL),存儲(chǔ)數(shù)據(jù)不以關(guān)系模型為依據(jù),不需要固定的表格式
2、非關(guān)系型數(shù)據(jù)庫作為關(guān)系數(shù)據(jù)庫的一一個(gè)補(bǔ)充,在日益快速發(fā)展的網(wǎng)站時(shí)代,發(fā)揮著高效率與高性能
3、非關(guān)系型數(shù)據(jù)庫的優(yōu)點(diǎn):
4、鍵-值方式(key-value),以鍵為依據(jù)存儲(chǔ)、刪、改數(shù)據(jù)
5、列存儲(chǔ)(Column-oriented),將相關(guān)的數(shù)據(jù)存儲(chǔ)在列族中
6、文檔的方式,數(shù)據(jù)庫由一系列數(shù)據(jù)項(xiàng)組成,每個(gè)數(shù)據(jù)項(xiàng)都有名稱與對(duì)應(yīng)的值
7、圖形方式,實(shí)體為頂點(diǎn),關(guān)系為邊,數(shù)據(jù)保存為一個(gè)圖形
8、Memcached是一個(gè)開源的、高性能的、具有分布式內(nèi)存對(duì)象的緩存系統(tǒng),以key-value方式存儲(chǔ)數(shù)據(jù)
9、redis也是一個(gè)以key-value方式存儲(chǔ)數(shù)據(jù)的,數(shù)據(jù)也是保存在內(nèi)存中,但會(huì)定期將數(shù)據(jù)寫入磁盤中
10、相對(duì)于Memcached有以下特點(diǎn):
11、redis應(yīng)用舉例
MySQL是一款深受歡迎的開源關(guān)系型數(shù)據(jù)庫
Oracle旗下的產(chǎn)品
遵守了GPL協(xié)議,可以免費(fèi)使用與修改
MySQL商業(yè)版是由MySQL AB公司負(fù)責(zé)開發(fā)與維護(hù),需要付費(fèi)才能使用
MySQL社區(qū)版是由分散在世界各地的MySQL 開發(fā)者、愛好者一起開發(fā)與維護(hù),可以免費(fèi)使用
第一陣營(yíng):5.0-5.1陣營(yíng),可說是早期產(chǎn)品的延續(xù)
第二陣營(yíng):5.4-5.7陣營(yíng),更好地整合了MySQL AB公司、社區(qū)、第三方公司開的存儲(chǔ)引擎,從而提高性能
MySQL下載網(wǎng)址:http://www.dev.mysql.com/downloads
[root@localhost ~]# yum -y install \ > ncurses \ > ncurses-devel \ > bison \ > cmake \ > gcc \ > gcc-c++ ........//省略安裝過程
[root@localhost ~]# useradd -s /sbin/nologin mysql [root@localhost ~]#
[root@localhost ~]# mkdir /mnt/tools [root@localhost ~]# mount.cifs //192.168.100.50/tools /mnt/tools/ Password for root@//192.168.100.50/tools: [root@localhost ~]# cd /mnt/tools/MySQL/ [root@localhost MySQL]# ls boost_1_59_0.tar.gz mysql-5.7.17.tar.gz [root@localhost MySQL]# tar zxvf mysql-5.7.17.tar.gz -C /opt/ ............//省略解壓過程 [root@localhost MySQL]#tar zxvf boost_1_59_0.tar.gz -C /usr/local/ ............//省略解壓過程 [root@localhost MySQL]#
[root@localhost MySQL]# cd /usr/local/ [root@localhost local]# mv boost_1_59_0/ boost [root@localhost local]# ls bin boost etc games include lib lib64 libexec sbin share src [root@localhost local]#
[root@localhost local]# cd /opt/mysql-5.7.17/ [root@localhost mysql-5.7.17]# cmake \ > -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ //安裝路徑 > -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \ //定義sock文件連接數(shù)據(jù)庫文件 > -DSYSCONFDIR=/etc \ //配置文件目錄 > -DSYSTEMD_PID_DIR=/usr/local/mysql \ //PID文件目錄 > -DDEFAULT_CHARSET=utf8 \ //指定字符集,utf8支持中文字符 > -DDEFAULT_COLLATION=utf8_general_ci \ 指定字符集默認(rèn) > -DWITH_INNOBASE_STORAGE_ENGINE=1 \ 存儲(chǔ)引擎 > -DWITH_ARCHIVE_STORAGE_ENGINE=1 \ > -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \ > -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \ > -DMYSQL_DATADIR=/usr/local/mysql/data \ //數(shù)據(jù)庫數(shù)據(jù)文件目錄 > -DWITH_BOOST=/usr/local/boost \ //底層運(yùn)行庫 > -DWITH_SYSTEMD=1 //主從參數(shù)
[root@localhost mysql-5.7.17]#make && make install ...........//省略編譯過程 [root@localhost mysql-5.7.17]#
[root@localhost mysql-5.7.17]# chown -R mysql.mysql /usr/local/mysql/ [root@localhost mysql-5.7.17]#
[root@localhost mysql-5.7.17]# vim /etc/my.cnf [client] //客戶端 port = 3306 default-character-set=utf8 socket = /usr/local/mysql/mysql.sock [mysql] //客戶端 port = 3306 default-character-set=utf8 socket = /usr/local/mysql/mysql.sock [mysqld] //云服務(wù)器 user = mysql //用戶 basedir = /usr/local/mysql //設(shè)置mysql的安裝目錄 datadir = /usr/local/mysql/data //設(shè)置mysql數(shù)據(jù)庫的數(shù)據(jù)的存放目錄 port = 3306 //設(shè)置3306端口 character_set_server=utf8 //中文字符集 pid-file = /usr/local/mysql/mysqld.pid //pid文件路徑 socket = /usr/local/mysql/mysql.sock //sock文件路徑 server-id = 1 //主從參數(shù) sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,PIPES_AS_CONCAT,ANSI_QUOTES //支持模塊 [root@localhost mysql-5.7.17]# chown mysql:mysql /etc/my.cnf //修改文件屬主屬組 [root@localhost mysql-5.7.17]#
[root@localhost mysql-5.7.17]# echo 'PATH=/usr/local/mysql/bin:/usr/local/mysql/lib:$PATH' >> /etc/profile //將MySQL寫到本地環(huán)境配置中 [root@localhost mysql-5.7.17]# echo 'export PATH' >> /etc/profile //設(shè)置全局環(huán)境配置 [root@localhost mysql-5.7.17]# source /etc/profile //重新加載配置文件 [root@localhost mysql-5.7.17]#
[root@localhost mysql-5.7.17]# cd /usr/local/mysql/ [root@localhost mysql]# bin/mysqld \ > --initialize-insecure \ //初始化 > --user=mysql \ //用戶 > --basedir=/usr/local/mysql \ //安裝目錄 > --datadir=/usr/local/mysql/data //數(shù)據(jù)庫數(shù)據(jù)文件目錄
[root@localhost mysql]# cp usr/lib/systemd/system/mysqld.service /lib/systemd/system/ //復(fù)制 [root@localhost mysql]# systemctl daemon-reload //重新加載 [root@localhost mysql]# systemctl start mysqld.service //啟動(dòng)服務(wù) [root@localhost mysql]# netstat -ntap | grep 3306 //查看tcp3306端口 tcp6 0 0 :::3306 :::* LISTEN 78684/mysqld [root@localhost mysql]# systemctl enable mysqld.service //設(shè)置開機(jī)自啟 Created symlink from /etc/systemd/system/multi-user.target.wants/mysqld.service to /usr/lib/systemd/system/mysqld.service. [root@localhost mysql]#
[root@localhost mysql]# mysqladmin -u root -p password Enter password: New password: Confirm new password: Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety. [root@localhost mysql]#
[root@localhost mysql]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.7.17 Source distribution Copyright (c) 2000, 2016, 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> grant all privileges on *.* to 'root'@'%' identified by 'abc123' with grant option; //提權(quán)讓所有終端能夠遠(yuǎn)程登錄 Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> quit //退出 Bye [root@localhost mysql]# [root@localhost mysql]# systemctl stop firewalld.service //關(guān)閉防火墻 [root@localhost mysql]# setenforce 0 //關(guān)閉增強(qiáng)性安全功能 [root@localhost mysql]#
[root@localhost mysql]# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 6 Server version: 5.7.17 Source distribution Copyright (c) 2000, 2016, 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> show databases; //查看數(shù)據(jù)庫 +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.00 sec)mysql>
對(duì)于上文關(guān)于實(shí)戰(zhàn)解決MySQL5.7版編譯安裝問題,大家覺得是自己想要的嗎?如果想要了解更多相關(guān),可以繼續(xù)關(guān)注我們的行業(yè)資訊板塊。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。