mysql 5.5安装

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql 5.5安装相关的知识,希望对你有一定的参考价值。

1、安装mysql5.5及5.5以上版本需要安装cmake

  1)下载cmake

         wget --no-check-certificate http://www.cmake.org/files/v2.8/cmake-2.8.7.tar.gz

  2)解压编译安装

         先安装所依赖的包:

         yum -y install gcc*

         tar zvxf cmake-2.8.7.tar.gz

         cd cmake-2.8.7

         ./configure

         make && make install

2、安装mysql

  1)下载mysql

         wget http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.47.tar.gz

  2)创建mysql用户与用户组

         groupadd mysql

         useradd -g mysql mysql

  3)解压安装

         tar zvxf mysql-5.5.47.tar.gz

          cd mysql-5.5.47

         使用cmake编译:

         cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \

         -DMYSQL_DATADIR=/mysql/data \

         -DDEFAULT_CHARSET=utf8 \

         -DDEFAULT_COLLATION=utf8_general_ci \

         -DWITH_EXTRA_CHARSETS:STRING=all \

         -DWITH_DEBUG=0 \

         -DWITH_SSL=yes \

         -DWITH_READLINE=1 \

         -DENABLED_LOCAL_INFILE=1

         make && make install

  4)生成新的mysql权限表

         mkdir -p /mysql/data

         ./scripts/mysql_install_db --user=mysql  -datadir=/mysql/data

         #此处如不指定datadir,到启动时会报错

  5)权限设置

         cd /usr/local/mysql

         chown -R mysql:mysql  /usr/local/mysql

         chown -R root .

         chown -R mysql data

         cp support-files/my-medium.cnf /etc/my.cnf

         /usr/local/mysql/bin/mysqld_safe --user=mysql &

         cp support-files/mysql.server /etc/init.d/mysqld

         chmod +x /etc/init.d/mysqld

         /etc/init.d/mysqld start

  6)验证

         /usr/local/mysql/bin/mysql

         Select @@version


本文出自 “Linux” 博客,请务必保留此出处http://syklinux.blog.51cto.com/9631548/1759080

以上是关于mysql 5.5安装的主要内容,如果未能解决你的问题,请参考以下文章

mysql 5.5源码包安装

CentOS 6.5通过yum安装 MySQL-5.5

CentOS 6.*通过yum安装 MySQL-5.5

mysql的5.5版本的安装

MySQL-5.5 安装

mysql 5.5安装