[LAMP]Mysql-5.6.28編譯安裝
環境引數:Linux:Centos6.5,cmake:3.3.2,mysql:5.6.28
1.下載cmake,下載地址:wget --no-check-certificate
2.安裝cmake
tar xf cmake-3.3.2.tar.gz
cd cmake-3.3.2
./configure
gmake && gmake install
3.下載mysql,下載地址:wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.28.tar.gz
4.新增mysql使用者和組
groupadd mysql
useradd mysql -s /sbin/nologin -M -g mysql
5.安裝ncurses-devel
yum install ncurses-devel -y
6.解壓mysql
tar xf mysql-5.6.28.tar.gz
cd mysql-5.6.28
7.編譯mysql
cmake . -DCMAKE_INSTALL_PREFIX=/application/mysql-5.6.28 \
-DMYSQL_DATADIR=/application/mysql-5.6.28/data \
-DMYSQL_UNIX_ADDR=/application/mysql-5.6.28/tmp/mysql.sock \
-DEXTRA_CHARSETS=gbk,gb2312,utf8,ascii \
-DENABLED_LOCAL_INFILE=ON \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
-DWITH_FAST_MUTEXES=1 \
-DWITH_ZLIB=bundled \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_READLINE=1 \
-DWITH_EMBEDDED_SERVER=1 \
-DWITH_DEBUG=0
注:如果make到63%左右出現錯誤:
make[2]: * [storage/perfschema/unittest/pfs_connect_attr-t] Error 1
make[1]: * [storage/perfschema/unittest/CMakeFiles/pfs_connect_attr-t.dir/all] Error 2
則:cmake去掉-DWITH_PARTITION_STORAGE_ENGINE=1引數重新編譯
8.mysql安裝
make && make install
9.做軟連線
ln -s /application/mysql-5.6.28/ /application/mysql
10.mysql目錄授權
chown -R mysql:mysql /application/mysql-5.6.28/
11.相關檔案
cd /application/mysql/support-files
cp my-default.cnf /etc/my.cnf
cp mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
12.mysql初始化
cd /application/mysql/scripts/
./mysql_install_db --basedir=/application/mysql/ --datadir=/application/mysql/data/ --user=mysql
13.啟動mysql
/etc/init.d/mysqld start
14.配置環境變數
echo 'export PATH=/application/mysql/bin:$PATH'>>/etc/profile
source /etc/profile
15.登陸mysql,刪除無用配置,只保留如下,並刪除test資料庫
mysql> select user,host from mysql.user;
+------+-----------+
| user | host |
+------+-----------+
| root | 127.0.0.1 |
| root | localhost |
+------+-----------+
mysql> drop database test;
16.配置登陸密碼
/application/mysql//bin/mysqladmin -u root password 'cancer'
17.設定mysql開機啟動
chkconfig mysqld on
chkconfig --list mysqld
1.下載cmake,下載地址:wget --no-check-certificate
2.安裝cmake
tar xf cmake-3.3.2.tar.gz
cd cmake-3.3.2
./configure
gmake && gmake install
3.下載mysql,下載地址:wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.28.tar.gz
4.新增mysql使用者和組
groupadd mysql
useradd mysql -s /sbin/nologin -M -g mysql
5.安裝ncurses-devel
yum install ncurses-devel -y
6.解壓mysql
tar xf mysql-5.6.28.tar.gz
cd mysql-5.6.28
7.編譯mysql
cmake . -DCMAKE_INSTALL_PREFIX=/application/mysql-5.6.28 \
-DMYSQL_DATADIR=/application/mysql-5.6.28/data \
-DMYSQL_UNIX_ADDR=/application/mysql-5.6.28/tmp/mysql.sock \
-DEXTRA_CHARSETS=gbk,gb2312,utf8,ascii \
-DENABLED_LOCAL_INFILE=ON \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
-DWITH_FAST_MUTEXES=1 \
-DWITH_ZLIB=bundled \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_READLINE=1 \
-DWITH_EMBEDDED_SERVER=1 \
-DWITH_DEBUG=0
注:如果make到63%左右出現錯誤:
make[2]: * [storage/perfschema/unittest/pfs_connect_attr-t] Error 1
make[1]: * [storage/perfschema/unittest/CMakeFiles/pfs_connect_attr-t.dir/all] Error 2
則:cmake去掉-DWITH_PARTITION_STORAGE_ENGINE=1引數重新編譯
8.mysql安裝
make && make install
9.做軟連線
ln -s /application/mysql-5.6.28/ /application/mysql
10.mysql目錄授權
chown -R mysql:mysql /application/mysql-5.6.28/
11.相關檔案
cd /application/mysql/support-files
cp my-default.cnf /etc/my.cnf
cp mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
12.mysql初始化
cd /application/mysql/scripts/
./mysql_install_db --basedir=/application/mysql/ --datadir=/application/mysql/data/ --user=mysql
13.啟動mysql
/etc/init.d/mysqld start
14.配置環境變數
echo 'export PATH=/application/mysql/bin:$PATH'>>/etc/profile
source /etc/profile
15.登陸mysql,刪除無用配置,只保留如下,並刪除test資料庫
mysql> select user,host from mysql.user;
+------+-----------+
| user | host |
+------+-----------+
| root | 127.0.0.1 |
| root | localhost |
+------+-----------+
mysql> drop database test;
16.配置登陸密碼
/application/mysql//bin/mysqladmin -u root password 'cancer'
17.設定mysql開機啟動
chkconfig mysqld on
chkconfig --list mysqld
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29812844/viewspace-1988850/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 編譯安裝LAMP環境編譯LAMP
- LAMP原始碼編譯安裝LAMP原始碼編譯
- [LAMP]Php-5.3.29編譯安裝LAMPPHP編譯
- LAMP兩種編譯安裝模式LAMP編譯模式
- LAMP 編譯安裝基本步驟LAMP編譯
- 詳解LAMP原始碼編譯安裝LAMP原始碼編譯
- LAMP原始碼編譯安裝配置+wordpressLAMP原始碼編譯
- [LAMP]Apache-2.2.31編譯安裝LAMPApache編譯
- LAMP純原始碼編譯安裝日誌LAMP原始碼編譯
- 在Centos5.2下編譯安裝LAMPCentOS編譯LAMP
- LAMP全功能編譯安裝forCentOS6.3筆記(更新)LAMP編譯CentOS筆記
- Centos6.8下編譯安裝LAMP的操作記錄梳理CentOS編譯LAMP
- CentOS5.5下快速編譯安裝最新的LAMP環境CentOS編譯LAMP
- lamp編譯詳解LAMP編譯
- 原始碼編譯安裝 httpd2.4+MariaDB5.5+php5.4(LAMP)原始碼編譯httpdPHPLAMP
- lamp安裝LAMP
- Apache伺服器的編譯安裝和LAMP環境的構建Apache伺服器編譯LAMP
- ubuntu手動編譯lampUbuntu編譯LAMP
- yum安裝lampLAMP
- 編譯LAMP環境之PHP編譯LAMPPHP
- 編譯搭建LAMP伺服器編譯LAMP伺服器
- 編譯安裝zabbix編譯
- apache編譯安裝Apache編譯
- 編譯安裝nmon編譯
- swoole 編譯安裝編譯
- 編譯安裝Nginx編譯Nginx
- 編譯安裝mysql編譯MySql
- nginx編譯安裝Nginx編譯
- 安裝編譯ffmpeg編譯
- Griffin編譯安裝編譯
- LAMP原始碼安裝+wordpress安裝LAMP原始碼
- 原始碼安裝lamp原始碼LAMP
- LAMP:用yum安裝LAMP
- Shell編譯安裝nginx編譯Nginx
- centos PHP 編譯安裝CentOSPHP編譯
- httpd編譯安裝phphttpd編譯PHP
- PHP的編譯安裝PHP編譯
- Mysql 5.7.17 編譯安裝MySql編譯