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

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

Linux源碼安裝mysql

源碼安裝MySQL

創(chuàng)新互聯(lián)建站從2013年創(chuàng)立,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項目成都做網(wǎng)站、網(wǎng)站設(shè)計網(wǎng)站策劃,項目實施與項目整合能力。我們以讓每一個夢想脫穎而出為使命,1280元敦煌做網(wǎng)站,已為上家服務(wù),為敦煌各地企業(yè)和個人服務(wù),聯(lián)系電話:18982081108

 

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

 

檢測

[root@server2mysql-5.7.11]#

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

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

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

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

-DDEFAULT_CHARSET=utf8#使用utf8字符

-DDEFAULT_COLLATION=utf8_general_ci

-DEXTRA_CHARSETS=all -DWITH_BOOST=boost/boost_1_59_0/

 

make && make install##這個編譯過程時間需要一個小時左右

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

重新編譯時,需要清除舊的對象文件和緩存信息

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#這樣就能自動補(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

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

這里還不能直接yum remove。yum remove會把軟件的依賴性一起刪除,并且會導(dǎo)致postfix等服務(wù)啟動出現(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#檢測是否排除上文提及的問題

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

啟動 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ù)制啟動腳本

[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這個用戶信息

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這個命令是不被認(rèn)同的,讓我們用mysqld --initialize這個命令

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

報錯信息會記錄再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就安裝成功了?。?!


文章名稱:Linux源碼安裝mysql
當(dāng)前地址:http://weahome.cn/article/piphjs.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部