mysql二进制版本与源码版本安装浅记
首先有两个版本的:http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.17-linux-glibc2.5-x86_64.tar.gzhttp://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.17.tar.gz第一个版本有200M的样子,为二进制版本;第二个版本有30多M的样子,为源码版本。
·
首先有两个版本的:
http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.17-linux-glibc2.5-x86_64.tar.gz
http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.17.tar.gz
http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.17.tar.gz
第一个版本有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
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
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.
解决:
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 .
rm CMakeCache.txt
cmake .
再次报错:
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: Internal CMake error, TryCompile configure of cmake failed
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
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
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
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
--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
更多推荐
已为社区贡献1条内容
所有评论(0)