centos 下搭建 php环境(2) mysql 安装

CentOS下的MySQL 5.1安装
 
01
02
 wget http://mysql.llarian.net/Downloads/MySQL-5.1/mysql-5.1.63.tar.gz
03
2.解压
04
 tar zvxf ./mysql-5.1.63.tar.gz
05
3.配置configure
06
   ./configure --prefix=/usr/local/mysql   
07  www.2cto.com  
    --with-charset=utf8   
08
    --with-extra-charsets=all   
09
    --with-tcp-port=3306   
10
    --with-unix-socket-path=/tmp/mysql.sock   
11
    --with-mysqld-user=mysqld  
12
    --with-federated-storage-engine   
13
    --with-mysqld-user=mysqld  
14
    --with-plugins=innobase,myisam   
15
    --enable-assembler   
16
    --without-isam   
17
    --with-client-ldflags=-all-static
18
 
19
  {
20
     出现checking for termcap functions library... configure: error: No            curses/termcap library found
21
     curses/termcap 库没有安装
22
     下载wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz
23
     解压 tar zxvf ncurses-5.9.tar.gz
24
     进入目录 sudo ./configure --prefix=/usr --with-shared --without-debug
25
     编译,安装 make , make install 
26  www.2cto.com  
   }   
27
4.编译,安裝
28
  make
29
  make install
30
5.创建用户和组.配置
31
  groupadd mysql
32
  useradd -g mysql mysql
33
  cp support-files/my-media.cnf /etc/my.cnf
34
  mkdir /usr/local/mysql/var
35
 
36
  修改MySQL 数据目录的 ownership
37
  chown -R mysql /usr/local/mysql /usr/lib/mysql /usr/share/mysql
38
  chgrp -R mysql /usr/local/mysql /usr/lib/mysql /usr/share/mysql
39
    www.2cto.com  
40
6.安装,启动,进入数据库.
41
  /usr/local/mysql/bin/mysql_install_db
42
  /user/local/mysql/bin/mysqld_safe
43
  /user/local/mysql/bin/mysql -u root
44
7.添加启动项
45
  mv /usr/local/mysqlshare/mysql/mysql.server /etc/init.d/mysql
46
  chmod 775 /etc/init.d/mysql
47
  chkconfig --add mysql
原文地址:https://www.cnblogs.com/timelesszhuang/p/3674989.html