CentOSx86_64安裝 編譯MYSQL5.5版本,須要使用cmake編譯器 下面爲我的筆記: cmake安裝 [root@localhost data]# wget http://www.cmake.org/files/v2.8/cmake-2.8.7.tar.gz [root@localhost data]# tar xvf cmake-2.8.7.tar.gz [root@localhost data]# cd cmake-2.8.7 [root@localhost cmake-2.8.7]#./configure [root@localhost cmake-2.8.7]#make && make install
//查看mysql5.5.21的編譯參數,發發現以下錯誤 [root@localhost mysql]# cmake . -LH -- MySQL 5.5.21 -- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH) CMake Error at cmake/readline.cmake:83 (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. 解決方式 [root@localhost mysql]# yum install ncurses-devel.x86_64 [root@localhost mysql]#make clean [root@localhost mysql]#rm -rf CMakeCache.txt [root@localhost mysql]# cmake . -LH -- -- MySQL 5.5.21 -- Configuring done -- Generating done -- Build files have been written to: /data/mysql -- Cache values // Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel CMAKE_BUILD_TYPE:STRING=RelWithDebInfo
# Preconfiguration setup shell> groupadd mysql shell> useradd -r -g mysql mysql # Beginning of source-build specific instructions shell> tar zxvf mysql-VERSION.tar.gz shell> cd mysql-VERSION shell> cmake . shell> make shell> make install # End of source-build specific instructions # Postinstallation setup shell> cd /usr/local/mysql shell> chown -R mysql.mysql /usr/local/mysql [root@localhost mysql]# scripts/mysql_install_db --user=mysql Installing MySQL system tables... OK Filling help tables... OK
To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands:
Alternatively you can run: ./bin/mysql_secure_installation
which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with: cd . ; ./bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl cd ./mysql-test ; perl mysql-test-run.pl
Please report any problems with the ./bin/mysqlbug script! shell> cp support-files/my-medium.cnf /etc/my.cnf shell> bin/mysqld_safe --user=mysql & # Next command is optional //查看MYSQL是否正常啓動 [root@localhost mysql]# ps -ef|grep mysql root 12381 2182 0 17:21 pts/0 00:00:00 /bin/sh bin/mysqld_safe --user=mysql mysql 12637 12381 0 17:21 pts/0 00:00:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/data/dbdata --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/data/dbdata/localhost.localdomain.err --pid-file=/data/dbdata/localhost.localdomain.pid --socket=/usr/local/mysql/tmp/mysql.sock --port=3306 root 12706 2236 0 18:45 pts/1 00:00:00 grep mysql shell> cp support-files/mysql.server /etc/init.d/mysql.server