mysql二进制版本与源码版本安装浅记

本文详细记录了MySQL二进制版本和源码版本的安装过程,包括遇到的问题及解决方法,如CMake错误、内存不足等,并提供了Apache和PHP的安装示例。
摘要由CSDN通过智能技术生成
首先有两个版本的:
第一个版本有200M的样子,为二进制版本;第二个版本有30多M的样子,为源码版本。
对于二进制版本安装:
cd /usr/local/mysql
 chown -R mysql .
 chgrp -R mysql .
 scripts/mysql_install_db --user=mysql
 chown -R root .
 chown -R mysql data
 bin/mysqld_safe --user=mysql &
 # Next command is optional
 cp support-files/mysql.server /etc/init.d/mysql.server
差不多就可以安装完成。
对于源码版本,首先要进行
shell> cmake .
shell> make
shell> make install
报错:
-- Could NOT find Curses  (missing:  CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:85 (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.
解决:
yum install  ncurses-devel

rm CMakeCache.txt
cmake .
再次报错:
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: Internal CMake error, TryCompile configure of cmake failed
解决:
yum install gcc gcc-c++
这样make install 后运行mysql报错:
Starting MySQL. ERROR! The server quit without updating PID file (/usr/local/mysql/data/AY1404041241339349a3Z.pid).
很容易认为是网页里常见的那些错误。。。。最后发现是没有安装完全。
于是:
cd /usr/local/mysql
 chown -R mysql .
 chgrp -R mysql .
 scripts/mysql_install_db --user=mysql
 chown -R root .
 chown -R mysql data
 bin/mysqld_safe --user=mysql &
 # Next command is optional
 cp support-files/mysql.server /etc/init.d/mysql.server
安装成功!
修改密码:mysqladmin -u root password new-password

另附Apache ,php安装样本:
Apache::::::::
./configure --with-apxs2=/usr/local/apache/bin/apxs  --enable-inline-optimization --enable-fpm --enable-mbstring --enable-xml --enable-wddx=shared --with-gd --with-gettext --with-mysql=/usr/local/mysql --with-regex=system --with-zlib-dir --with-mpm=worker
 
 ln -s /usr/local/apache/bin/apachectl /etc/rc.d/init.d/apache
 
php安装前需要的一些包包:
 yum install openssl-devel
 yum install bzip2-devel
 yum -y install  curl-devel
 yum install libjpeg-turbo-devel
 yum install freetype-devel
对于512M的服务器会报错:
 virtual memory exhausted: Cannot allocate memory
解决:
 --disable-fileinfo
 
 ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-libxml-dir=/usr/local/libxml2 --with-gd --with-jpeg-dir --with-png-dir --with-bz2 --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --disable-ipv6 --disable-cgi --disable-cli --with-mysqli --with-curl --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --disable-fileinfo
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值