原始碼包方式安裝Percona server
Installing Percona Server from a Source Tarball
1 下載原始碼tar包
2 安裝Cmake
下載cmake:
]# tar -zxvf cmake-2.8.9.tar.gz
]# cd cmake-2.8.9
#檢視幫助
]# cat Readme.txt
$ ./bootstrap; make; make install
]# ./bootstrap
]# make
]# make install
3 建立相關目錄
#basedir
~]# mkdir -p /app/mysql
#datadir
~]# mkdir -p /data/percona/mysql/data
~]# chown mysql:mysql /app/mysql/ -R
~]# chown mysql:mysql /data/percona/mysql/ -R
4 解壓
]# tar -zxvf percona-server-5.6.29-76.2.tar.gz
]# cd percona-server-5.6.29-76.2
5 編譯安裝
1 使用cmake配置bulid
]#cmake . -LH
]#cmake . \
-DCMAKE_INSTALL_PREFIX=/app/mysql \ #設定程式安裝路徑
-DMYSQL_DATADIR=/data/percona/mysql/data \ #設定資料存放路徑
-DSYSCONFDIR=/app/mysql \ #配置檔案路徑,由於當前有別的mysql例項執行,沒有指定/etc
-DWITH_MYISAM_STORAGE_ENGINE=1 \ #啟用MYISAM儲存引擎
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DMYSQL_UNIX_ADDR=/data/percona/mysql/mysqld.sock \ #設定套接字存放位置
-DMYSQL_TCP_PORT=6603 \ #設定開放埠
-DENABLED_LOCAL_INFILE=1 \ #設定讀取本地檔案
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 \ #預設字串
-DDEFAULT_COLLATION=utf8_general_ci #預設檢驗規則
附,如果cmake錯誤,需要重新cmake,需要清除之前的cmake資訊:
]# make clean
]# rm –f CMakeCache.txt
2 使用make編譯
#-j後面是邏輯CPU的個數,可以根據實際情況來指定
]#make -j `grep processor /proc/cpuinfo | wc -l`
3 使用make install安裝
]#make install
6 建立配置檔案
]# cat /app/mysql/my.cnf
[mysqld]
basedir=/app/mysql
datadir=/data/percona/mysql/data
socket=/data/percona/mysql/mysql.sock
log-error=/data/percona/mysql/mysqld.log
innodb_buffer_pool_size = 128M
port=6603
7 初始化db
]# ./scripts/mysql_install_db --defaults-file=/app/mysql/my.cnf
8 啟動percona mysql
#注意,如果使用的root賬戶初始化db,生成的檔案都是root擁有,而mysqld是以mysql使用者執行的,對預設生成的檔案沒許可權,可能無法正常start,如報錯:
26803 [Note] Plugin 'FEDERATED' is disabled.
/app/mysql/bin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13 - Permission denied)
2016-05-04 14:40:21 26803 [ERROR] InnoDB: ./ibdata1 can't be opened in read-write mode
2016-05-04 14:40:21 26803 [ERROR] InnoDB: The system tablespace must be writable!
2016-05-04 14:40:21 26803 [ERROR] Plugin 'InnoDB' init function returned error.
2016-05-04 14:40:21 26803 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2016-05-04 14:40:21 26803 [ERROR] Unknown/unsupported storage engine: InnoDB
2016-05-04 14:40:21 26803 [ERROR] Aborting
#此時,修改basedir和datadir下的檔案的所有者和所屬組為mysql
]# chown mysql:mysql /data/percona/mysql/ -R
]# chown mysql:mysql /app/mysql/ -R
#再啟動mysql
]# /data/percona/mysql/bin/mysqld_safe --defaults-file=/tmp/my.cnf &
160504 10:37:02 mysqld_safe Adding '/data/percona/mysql/lib/mysql/libjemalloc.so.1' to LD_PRELOAD for mysqld
160504 10:37:02 mysqld_safe Logging to '/data/percona/mysql/mysqld.log'.
160504 10:37:02 mysqld_safe Starting mysqld daemon with databases from /data/percona/mysql/data
9 檢視程式
]# netstat -antpl|grep mysqld
tcp 0 0 :::6603 :::* LISTEN 27166/mysqld #percona mysql
tcp 0 0 :::3306 :::* LISTEN 23233/mysqld #預設執行的mysql
10 檢視log
]# tail -f /data/percona/mysql/mysqld.log
2016-05-04 14:42:02 27166 [Note] InnoDB: Waiting for purge to start
2016-05-04 14:42:02 27166 [Note] InnoDB: Percona XtraDB () 5.6.29-76.2 started; log sequence number 1626426
2016-05-04 14:42:02 27166 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 4eeaade7-11c3-11e6-86b0-782bcb6aa29a.
2016-05-04 14:42:02 27166 [Note] Server hostname (bind-address): '*'; port: 6603
2016-05-04 14:42:02 27166 [Note] IPv6 is available.
2016-05-04 14:42:02 27166 [Note] - '::' resolves to '::';
2016-05-04 14:42:02 27166 [Note] Server socket created on IP: '::'.
2016-05-04 14:42:02 27166 [Note] Event Scheduler: Loaded 0 events
2016-05-04 14:42:02 27166 [Note] /app/mysql/bin/mysqld: ready for connections.
Version: '5.6.29-76.2' socket: '/data/percona/mysql/mysql.sock' port: 6603 Source distribution
11 解除安裝percona server
a.Stop percona mysql server
b.rm –rf basedir && rm –rf datadir
參考:
http://blog.itpub.net/27000195/viewspace-2093534/ rpm包方式安裝
http://blog.itpub.net/27000195/viewspace-2093561/ 二進位制tar包方式安裝
http://blog.itpub.net/27000195/viewspace-2093563/ 原始碼方式安裝
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27000195/viewspace-2093563/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- rpm包方式安裝Percona serverServer
- Percona XtraBackup 原始碼安裝原始碼
- percona-server-5.7.11-4原始碼安裝手冊Server原始碼
- Percona MySQL 5.6 RPM包方式安裝流程MySql
- percona5.7 原始碼安裝原始碼
- Percona Server TokuDB安裝Server
- CentOS 6.4 x64 Percona-Server-5.6.15 原始碼安裝CentOSServer原始碼
- percona-toolkit原始碼編譯安裝原始碼編譯
- percona-server-rocksdb-8.0.32 安裝Server
- 原始碼包安裝過程原始碼
- Linux 原始碼方式安裝zipLinux原始碼
- 原始碼方式安裝mysql cluster 7.3.3原始碼MySql
- 原始碼方式安裝mysql 5.6.15原始碼MySql
- 原始碼包安裝mysql5.1原始碼MySql
- centos 5.8 編譯安裝 percona server 5.6.33CentOS編譯Server
- CentOS下使用yum方式安裝percona xtrabackup步驟CentOS
- percona-toolkit工具包的安裝和使用
- Greenplum_原始碼編譯安裝和RPM包安裝原始碼編譯
- RedHat 6.4原始碼方式安裝mysql5.5Redhat原始碼MySql
- 如何編譯安裝原始碼包軟體編譯原始碼
- linux下Percona-Server(mysql衍生版)的安裝LinuxServerMySql
- MySQL 5.7.17 原始碼方式安裝詳細步驟MySql原始碼
- Linux 筆記分享十五:原始碼包安裝Linux筆記原始碼
- RHEL 6下原始碼包安裝部署Ansible原始碼
- 原始碼包編譯安裝MySQL 5.6指令碼原始碼編譯MySql指令碼
- 安裝aab包的兩種方式
- yum方式安裝Percona XtraBackup報錯解決一例
- shell指令碼企業實戰系列-nginx原始碼包安裝指令碼Nginx原始碼
- SQL server開啟 安裝包時報錯SQLServer
- linux下安裝perconaLinux
- MySQL 5.5 原始碼安裝報錯"[ERROR] Can't start server"MySql原始碼ErrorServer
- LAMP原始碼安裝+wordpress安裝LAMP原始碼
- Linux-軟體包管理-RPM安裝位置\原始碼包安裝位置Linux原始碼
- CentOS 7版本原始碼編譯方式安裝TokuDBCentOS原始碼編譯
- Linux下原始碼編譯方式安裝MySQL5.5Linux原始碼編譯MySql
- PHP 容器中安裝原始碼包中的擴充套件PHP原始碼套件
- python原始碼包怎麼下載?方便安裝嗎?Python原始碼
- 使用CheckInstall從原始碼製作RPM安裝包原始碼