LINUX環境下MYSQL5.5原始碼安裝(2012年3月26日更新)
首先到http://www.cmake.org/cmake/resources/software.html
cd /mysql
1.安裝cmake
1)下載cmake
#wget http://www.cmake.org/files/v2.8/cmake-2.8.7.tar.gz
2)解壓cmake
#tar -zvxf cmake-2.8.7.tar.gz
3)配置編譯
#cd cmake-2.8.7
#yum -y install gcc
#yum -y install gcc-c++
#./configure
#make
#make install
2.安裝MYSQL
1)下載MYSQL
#cd /mysql
#wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.21.tar.gz/from/http://mysql.mirror.rafal.ca/
2)解壓mysql-5.5.21.tar.gz
#tar -zvxf mysql-5.5.21.tar.gz
建立資料目錄(mysql5.5預設已經沒有data目錄了)
mkdir /mysql/mysql/data
3)配置編譯
#cd mysql-5.5.21
#cmake . ##這個方法,安裝路徑預設
或
#cmake . \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_INSTALL_PREFIX:PATH=/mysql/mysql \
-DCOMMUNITY_BUILD:BOOL=ON \
-DENABLED_PROFILING:BOOL=ON \
-DENABLE_DEBUG_SYNC:BOOL=OFF \
-DINSTALL_LAYOUT:STRING=STANDALONE \
-DMYSQL_DATADIR:PATH=/mysql/mysql/data \
-DMYSQL_MAINTAINER_MODE:BOOL=OFF \
-DWITH_EMBEDDED_SERVER:BOOL=ON \
-DWITH_EXTRA_CHARSETS:STRING=all \
-DWITH_SSL:STRING=bundled \
-DWITH_UNIT_TESTS:BOOL=OFF \
-DWITH_ZLIB:STRING=bundled \
-LH
如果出現一下錯誤:
cmake .
-- MySQL 5.5.21
-- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:82 (MESSAGE):
Curses library not found. Please install appropriate package,
remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
cmake/readline.cmake:126 (FIND_CURSES)
cmake/readline.cmake:216 (MYSQL_USE_BUNDLED_LIBEDIT)
CMakeLists.txt:256 (MYSQL_CHECK_READLINE)
-- Configuring incomplete, errors occurred!
安裝:
# yum -y install ncurses-devel
#make
#make install
#groupadd mysql
#useradd -r -g mysql mysql
#cd /mysql/mysql
#chown -R mysql:mysql .
#scripts/mysql_install_db --user=mysql
#chown -R root .
#chown -R mysql data
#cp ./support-files/my-small.cnf ./my.cnf
#cp support-files/mysql.server mysql; chmod +x mysql
#chown -R mysql:root .
#./mysql start
#./bin/mysqladmin -u root password
錯誤解決
1) ./scripts/mysql_install_db
Installing MySQL system tables...
101223 14:28:49 [ERROR] ./bin/mysqld: unknown option '--skip-locking'
101223 14:28:49 [ERROR] Aborting
101223 14:28:49 [Note] ./bin/mysqld: Shutdown complete
由於是以前安裝過mysql ,所以存在/etc/my.cnf,而且mysql的環境變數和現在的不一樣,
從而影響 現在的,解決方法是:rm -rf /etc/my.cnf
2 ) ./scripts/mysql_install_db --basedir/mysql/mysql/ --datadir/mysql/mysql/data/mysql --user=mysql
檢視原因:cat data/xcw.err
101223 15:39:18 mysqld_safe Starting mysqld daemon with databases from /w/mysqld558/data
/w/mysqld558/bin/mysqld: Table 'mysql.plugin' doesn't exist
101223 15:39:18 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use InnoDB's own implementation
InnoDB: Compressed tables use zlib 1.2.3
101223 15:39:18 InnoDB: Using Linux native AIO
101223 15:39:18 InnoDB: Initializing buffer pool, size = 128.0M
101223 15:39:18 InnoDB: Completed initialization of buffer pool
101223 15:39:18 InnoDB: highest supported file format is Barracuda.
101223 15:39:18 InnoDB: 1.1.4 started; log sequence number 1588771
101223 15:39:18 [ERROR] //mysql/mysql/bin/mysqld: unknown option '--skip-locking'
101223 15:39:18 [ERROR] Aborting
原因同上,處理也同上
3) 啟動mysql服務時出現:
Starting MySQL.The server quit without updating PID file (/w/mysqld558/xcw.pid).[FAILED]
原因是由於data沒有設定好,解決:vi mysql : datadir=/w/mysqld558 fix to datadir=/mysql/mysql/data
大功告成!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8183550/viewspace-682189/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Linux下原始碼編譯方式安裝MySQL5.5Linux原始碼編譯MySql
- CentOS 7.4 環境下原始碼編譯(多例項)安裝 Mysql 5.7.26CentOS原始碼編譯MySql
- Linux環境PostGIS原始碼編譯安裝Linux原始碼編譯
- mysql5.5的原始碼安裝MySql原始碼
- Linux環境下原始碼編譯方式安裝MySQL5.1(3)Linux原始碼編譯MySql
- Linux環境下原始碼編譯方式安裝MySQL5.1(2)Linux原始碼編譯MySql
- Linux環境下原始碼編譯方式安裝MySQL5.1(1)Linux原始碼編譯MySql
- Linux下安裝Go環境LinuxGo
- Windows環境下安裝LinuxWindowsLinux
- linux環境下redis安裝LinuxRedis
- Linux環境下安裝NginxLinuxNginx
- LINUX環境下安裝TIPTOPLinux
- Linux下Java環境安裝LinuxJava
- Linux 安裝 mysql 5.5.8(cmake原始碼安裝mysql5.5以上版本)[轉]LinuxMySql原始碼
- Linux7.8環境下的原始碼安裝部署PG14.8Linux原始碼
- linux或者CentOS環境下安裝.NET Core環境LinuxCentOS
- lnmp環境安裝-原始碼編譯LNMP原始碼編譯
- Linux下原始碼搭建LAMP環境Linux原始碼LAMP
- Linux環境下nginx安裝配置LinuxNginx
- Linux環境下ApacheActiveMQ基本安裝LinuxApacheMQ
- 在linux環境下安裝MysqlLinuxMySql
- 在Linux環境下安裝JBOSSLinux
- RedHat 6.4原始碼方式安裝mysql5.5Redhat原始碼MySql
- CentOS 7.4 環境下原始碼編譯安裝 postgreSQL 11.4CentOS原始碼編譯SQL
- Linux 下使用 Docker 安裝lnmp環境LinuxDockerLNMP
- linux環境下安裝nginx步驟LinuxNginx
- Linux 環境下編譯安裝 RedisLinux編譯Redis
- Linux環境下Apache ActiveMQ 基本安裝LinuxApacheMQ
- linux64bit下安裝mysql5.5LinuxMySql
- 在linux環境下安裝JDK並配置環境變數LinuxJDK變數
- Linux環境下 RabbitMQ 的下載與安裝LinuxMQ
- Windows 環境下 Python 環境安裝WindowsPython
- Linux下PostgreSQL原始碼安裝LinuxSQL原始碼
- Linux下安裝JDK及環境設定LinuxJDK
- Linux 下 Go 環境搭建以及 Gin 安裝LinuxGo
- yapi 在linux環境下的安裝部署APILinux
- linux環境下軟體安裝之MavenLinuxMaven
- Linux 環境下如何安裝部署 RocketMQ 教程LinuxMQ