LINUX 源码编译安装MYSQL-5.5.8
准备工作: 新建用户和用户组 groupadd mysql useradd -g mysql mysql 1:下载: bison-2.4.2.tar.bz2 cmake-2.8.3.tar.gz make-3.82.tar.gz bzr-2.3b5.tar.gz mysql-5.5.8.tar.gz 2:解压安装前3个包
tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3 ./configure make make install
tar zxvf make-3.82.tar.gz cd make-3.8.2 ./configure make make install
tar jxvf bison-2.4.2.tar.bz2 cd bison-2.4.2 ./configure make make install
3:解压mysql-5.5.8.tar.gz tar zxvf mysql-5.5.8.tar.gz cd mysql-5.5.8
cmake . -DCMAKE_INSTALL_PREFIX=/mysql/mysqldir -DMYSQL_DATADIR=/mysql/mysqldir/data -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_TCP_PORT=3306 -DMYSQL_UNIX_ADDR==/mysql/mysqldir/data/mysql.sock -DMYSQL_USER=mysql -DWITH_DEBUG=0
报错(如无报错直接make & make install 即可):
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!
缺少包:ncurses-devel 解决: 到安装光盘或者网上DOWN相应的包 安装: cmake . -DCMAKE_INSTALL_PREFIX=/mysql/mysqldir -DMYSQL_DATADIR=/mysql/mysqldir/data -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_TCP_PORT=3306 -DMYSQL_UNIX_ADDR==/mysql/mysqldir/data/mysql.sock -DMYSQL_USER=mysql -DWITH_DEBUG=0
make make install
完成后进入MYSQL安装目录 cd /mysql/mysqldir cp support-files/my-huge.cnf /etc/my.cnf vi /etc/my.cnf 将数据目录和套接字文件修改为实际值.
修改权限 chown mysql:mysql /etc/my.cnf chown -R mysql:mysql /mysql/mysqldir 切换用户进入安装目录 su - mysql cd /mysql/mysqldir cp scripts/mysql_install_db . ./ mysql_install_db 启动MYSQL bin/mysqld_safe & OK
http://forge.mysql.com/wiki/Autotools_to_CMake_Transition_Guide
本文出自 “Xin23的历程” 博客,请务必保留此出处http://xin23.blog.51cto.com/1827266/488261 |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |