真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

Linux源碼安裝mysql-創(chuàng)新互聯(lián)

源碼安裝mysql

堅(jiān)守“ 做人真誠(chéng) · 做事靠譜 · 口碑至上 · 高效敬業(yè) ”的價(jià)值觀,專業(yè)網(wǎng)站建設(shè)服務(wù)10余年為成都成都搬家公司小微創(chuàng)業(yè)公司專業(yè)提供成都企業(yè)網(wǎng)站定制營(yíng)銷網(wǎng)站建設(shè)商城網(wǎng)站建設(shè)手機(jī)網(wǎng)站建設(shè)小程序網(wǎng)站建設(shè)網(wǎng)站改版,從內(nèi)容策劃、視覺(jué)設(shè)計(jì)、底層架構(gòu)、網(wǎng)頁(yè)布局、功能開(kāi)發(fā)迭代于一體的高端網(wǎng)站建設(shè)服務(wù)。

tar zxf mysql-boost-5.7.11.tar.gz

rpm -ivh cmake-2.8.12.2-4.el6.x86_64.rpm

yum install cmake-2.8.12.2-4.el6.x86_64.rpm -y

cd mysql-5.7.11/

yum install gcc-c++ ncurses-devel bison-y

檢測(cè)

[root@server2mysql-5.7.11]#

 cmake -DCMAKE_INSTALL_PREFIX=/usr/local/lnmp/mysql#安裝目錄

-DMYSQL_DATADIR=/usr/local/lnmp/mysql/data#數(shù)據(jù)庫(kù)存放目錄

-DMYSQL_UNIX_ADDR=/usr/local/lnmp/mysql/data/mysql.sock #Unix socket文件路徑-DWITH_MYISAM_STORAGE_ENGINE=1 #安裝myisam存儲(chǔ)引擎-DWITH_INNOBASE_STORAGE_ENGINE=1# 安裝 innodb 存儲(chǔ)引擎-DWITH_PARTITION_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1

#安裝數(shù)據(jù)庫(kù)分區(qū)

-DDEFAULT_CHARSET=utf8#使用utf8字符

-DDEFAULT_COLLATION=utf8_general_ci

-DEXTRA_CHARSETS=all -DWITH_BOOST=boost/boost_1_59_0/

make && make install##這個(gè)編譯過(guò)程時(shí)間需要一個(gè)小時(shí)左右

##在make install階段如果出現(xiàn)很多紅色的字體,并且界面卡住了,可以直接ctrl +C中斷安裝狀態(tài),重新執(zhí)行make install即可

重新編譯時(shí),需要清除舊的對(duì)象文件和緩存信息

make clean

rm -f CmakeCache.txt

然后再繼續(xù)camak,make && make install

cd /usr/local/lnmp/mysql/bin

[root@server2 bin]# vim ~/.bash_profile

10 PATH=$PATH:$HOME/bin:/usr/local/lnmp/mysql/bin#這樣就能自動(dòng)補(bǔ)齊

[root@server2 bin]# source ~/.bash_profile#刷新,立即生效

[root@server2 bin]# cd ..

[root@server2 mysql]# cd support-files/

[root@server2 support-files]# rpm -e `rpm -qa | grep mysql` --nodeps

warning: /var/log/mysqld.log saved as /var/log/mysqld.log.rpmsave

說(shuō)明:由于本機(jī)之前安裝過(guò)mysql 所以源碼安裝的時(shí)候需要清除環(huán)境影響

這里還不能直接yum remove。yum remove會(huì)把軟件的依賴性一起刪除,并且會(huì)導(dǎo)致postfix等服務(wù)啟動(dòng)出現(xiàn)故障。

[root@server2 support-files]# yum install mysql-libs -y

[root@server2 support-files]# yum check

[root@server2 support-files]# /etc/init.d/postfix restart#檢測(cè)是否排除上文提及的問(wèn)題

關(guān)閉 postfix:                                             [確定]

啟動(dòng) postfix:                                             [確定]

[root@server2 support-files]# rpm -qa | grep mysql

mysql-libs-5.1.71-1.el6.x86_64

[root@server2 support-files]# cat /etc/my.cnf

[mysqld]

datadir=/var/lib/mysql

socket=/var/lib/mysql/mysql.sock

user=mysql

# Disabling symbolic-links is recommended to prevent assorted security risks

symbolic-links=0

[mysqld_safe]

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

[root@server2 support-files]# cp /etc/my.cnf /etc/my.cnf.bak

[root@server2 support-files]# cp my-default.cnf /etc/my.cnf

cp:是否覆蓋"/etc/my.cnf"?y

[root@server2 support-files]# file mysql.server

mysql.server: POSIX shell script text executable

[root@server2 support-files]# cp mysql.server /etc/init.d/mysqld#復(fù)制啟動(dòng)腳本

[root@server2 mysql]# cd /var/lib/

[root@server2 lib]# /etc/init.d/mysqld status

 ERROR! MySQL is not running

[root@server2 lib]# cd /usr/local/lnmp/mysql/

[root@server2 mysql]# ls

bin  COPYING  docs  include  lib  man  mysql-test  README  share  support-files

[root@server2 mysql]# ll

總用量 56

drwxr-xr-x  2 root root  4096 3月  22 23:38 bin

-rw-r--r--  1 root root 17987 2月   2 2016 COPYING

drwxr-xr-x  2 root root  4096 3月  22 23:37 docs

drwxr-xr-x  3 root root  4096 3月  22 23:37 include

drwxr-xr-x  4 root root  4096 3月  22 23:38 lib

drwxr-xr-x  4 root root  4096 3月  22 23:37 man

drwxr-xr-x 10 root root  4096 3月  22 23:38 mysql-test

-rw-r--r--  1 root root  2478 2月   2 2016 README

drwxr-xr-x 28 root root  4096 3月  22 23:38 share

drwxr-xr-x  2 root root  4096 3月  22 23:38 support-files

[root@server2 mysql]# grep mysql /etc/passwd#查看mysql這個(gè)用戶信息

mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/bash

[root@server2 mysql]# grep mysql /etc/shadow

mysql:!!:17218::::::

[root@server2 mysql]# chown mysql.mysql . -R#將當(dāng)前目錄下所有文件的所有人所有組都設(shè)置成mysql -R表示第歸

[root@server2 mysql]# which mysql

/usr/local/lnmp/mysql/bin/mysql

[root@server2 mysql]# mysql_install_db --user=mysql --basedir=/usr/local/lnmp/mysql/ --datadir=/usr/local/lnmp/mysql/data

2017-03-23 00:24:03 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize

##mysql_install_db這個(gè)命令是不被認(rèn)同的,讓我們用mysqld --initialize這個(gè)命令

2017-03-23 00:24:42 [WARNING] The bootstrap log isn't empty:

2017-03-23 00:24:42 [WARNING] 2017-03-22T16:24:03.786590Z 0 [Warning] --bootstrap is deprecated. Please consider using --initialize instead

2017-03-22T16:24:03.792333Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)

2017-03-22T16:24:03.792343Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)

[root@server2 mysql]# pwd

/usr/local/lnmp/mysql

[root@server2 mysql]# cd data/

[root@server2 data]# rm -fr *

[root@server2 data]# cd ..

[root@server2 mysql]# mysqld --initialize --user=mysql --basedir=/usr/local/lnmp/mysql/ --datadir=/usr/local/lnmp/mysql/data

當(dāng)最后輸出如下:

2017-03-22T16:27:58.726507Z 1 [Note] A temporary password is generated for root@localhost: W_Ad1p4htKk-##加粗字體是mysql的初始登陸密碼

[root@server2 mysql]# chown root.root . -R

[root@server2 mysql]# chown mysql data -R

[root@server2 mysql]# cd data/

[root@server2 data]# ls

auto.cnf        ibdata1      ib_logfile1  performance_schema

ib_buffer_pool  ib_logfile0  mysql        sys

[root@server2 mysql]# /etc/init.d/mysqld start

Starting MySQL. SUCCESS!

[root@server2 data]# ls

auto.cnf        ib_logfile1      mysql.sock               server2.example.com.pid

ib_buffer_pool  ibtmp1           mysql.sock.lock          sys

ibdata1         mysql            performance_schema

ib_logfile0     mysqld_safe.pid  server2.example.com.err

報(bào)錯(cuò)信息會(huì)記錄再server2.example.com.err文件中

[root@server2 data]# mysql -p

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 3

Server version: 5.7.11

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> alter user root@localhost identified by 'lyitx+110';##重新設(shè)置密碼

Query OK, 0 rows affected (0.00 sec)

mysql> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| mysql              |

| performance_schema |

| sys                |

+--------------------+

4 rows in set (0.00 sec)

mysql> exit

Bye

這樣mysql就安裝成功了?。。?/em>

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。


新聞名稱:Linux源碼安裝mysql-創(chuàng)新互聯(lián)
當(dāng)前路徑:http://weahome.cn/article/dgisos.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部