admin
管理员
管理员
  • UID1
  • 粉丝2
  • 关注2
  • 发帖数339
  • 社区居民
  • 忠实会员
  • 原创写手
阅读:4689回复:0

Linux Mysql5.5.x的安装与配置

楼主#
更多 发布于:2014-04-23 20:27
分享到:
与之前版本不同,Linux Mysql5.5.x的安装要基于cmake环境安装,我们以5.5.8为例进行安装与配置
Setup 1:
安装cmake
#wget -c http://www.cmake.org/files/v2.8/cmake-2.8.3.tar.gz
#tar -zxvf cmake-2.8.3.tar.gz
#cd cmake-2.8.3
#./bootstrap
#./configure
#make && make install
Setup 2:
安装MYSQL 5.5.8
#wget -c http://blog.s135.com/soft/linux/nginx_php/mysql/mysql-5.5.2-m2.tar.gz
tar -zxvf mysql-5.5.2-m2.tar.gz
#cd mysql-5.5.2-m2
#cmake
 -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DEXTRA_CHARSETS=all
-DENABLED_LOCAL_INFILE=1 -DWITH_READLINE=1 -DDEFAULT_CHARSET=utf8
-DDEFAULT_COLLATION=utf8_general_ci -DWITH_EMBEDDED_SERVER=1
-DWITH_SSL=system
#make && make install
慢长的等待过后终于完成了
#groupadd mysql
#useradd -g mysql mysql
#cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf
#vim /etc/my.cnf #需要加入basedir,和datadir否则会出问题
[mysqld]
basedir =/usr/local/mysql
datadir =/usr/local/mysql/data
#/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data &
#chown -R mysql /usr/local/mysql/data
#chgrp -R mysql /usr/local/mysql/.
#cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
#chmod 755 /etc/init.d/mysql
#chkconfig --level 345 mysql on
#echo “/usr/local/mysql/lib/mysql” >> /etc/ld.so.conf
#echo “/usr/local/lib” >>/etc/ld.so.conf
#ldconfig
#/etc/init.d/mysql start
#/usr/local/mysql/bin/mysqladmin -u root password broadengate
Empire CMS,phome.net
#/etc/init.d/mysql restart
#/etc/init.d/mysql stop
OK终于完成~
常见问题:
1. /etc/init.d/mysql: line 256: my_print_defaults: command not found
解决方法: 检查/etc/my.cnf是否存在datadir和basedir如果没有请增加 datadir和basedir目录路径.
Empire CMS,phome.net
如下
[mysqld]
port = 3306
basedir =/usr/local/mysql
datadir =/usr/local/mysql/data
This entry was posted in Mysql. Bookmark the permalink.
游客

返回顶部