www.2003.comLinux系统中安装Apache Php Mysql详细教程

2019-10-26 作者:计算机教程   |   浏览(135)

操作系统:CentOS 4.3

mysql的编译安装

软件列表:httpd-2.2.4.tar.gz, mysql-5.0.18.tar.gz, php-5.2.1.tar.gz

 

一.linux下安装mysql

#tar xvfz mysql-5.1.41.tar.gz

小弟最近搞mysql源码安装,安装过程如下:

#cd mysql-5.1.41

安装步骤:

#echo " CHOST="x86_64-pc-linux-gnu"  CFLAGS="-march=native -O3 -pipe -fomit-frame-pointer" CXX=gcc CXXFLAGS="-march=native -O3 -pipe -fomit-frame-pointer  -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock --enable-assembler --with-libwrap=/usr/lib/ --with-charset=gbk --with-extra-charsets=gb2312,gbk,big5,latin1,utf8 --with-mysqld-user=mysql --with-big-tables --with-client-ldflags=-all-static --with-plugins=myisam,myisammrg,innobase,innodb_plugin,heap,csv,partition --with-mysqld-ldflags=-all-static" >configure.sh  // 编译安装

1.groupadd mysql

#chmod x configure.sh

2.useradd -g mysql mysql

#./configure.sh

3.tar zxvf myql-5.0.18.tar.gz

 

4.cd mysql-5.0.18.tar.gz

#make && make install

5../configure= prefix=/usr/local/mysql

  www.2cto.com  

6.make

#groupadd mysql    /添加一个mysql组

7.make install

#useradd -g mysql mysql  添加一个mysql用户到mysql组里

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

 

9.cd /usr/local/mysql

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

10.bin/mysql_install_db --user=mysql

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

11.chown -R root .

#chmod 700 /etc/init.d/mysqld

12.chown -R mysql var

#chkconfig --add mysqld

13.chgrp -R mysql .

#chkconfig --level 345 mysqld on

14.bin/mysqld-safe --user=mysql &

 

检查日志:more var/localhost.err:

#cd /usr/local/mysql

070129 15:05:58 mysqld started

#bin/mysql_install_db --user=mysql

070129 15:05:58 InnoDB: Started; log sequence number 0 43655

 

070129 15:05:58 [Note] /usr/local/mysql/libexec/mysqld: ready for connections.

#chown -R root .

Version: '5.0.18-log' socket: '/tmp/mysql.sock' port: 3306 Source distribution

#chown -R mysql var

www.2003.com 1

#chgrp -R mysql .

 

#bin/mysqld_safe --user=mysql &

#bin/mysqladmin -uroot -poldpwd password XXXX

  www.2cto.com  

mysql 多实例安装

===================================多实例安装=======================================

#tar xvfz mysql-5.1.59.tar.gz

 

#cd mysql-5.1.59(Linux 5.3)

echo " CFLAGS="-O3 -mpentiumpro" CXX=gcc CXXFLAGS="-O3 -mpentiumpro -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock --enable-assembler --with-libwrap=/usr/lib/ --with-charset=gbk --with-extra-charsets=gb2312,gbk,big5,latin1,utf8 --with-mysqld-user=mysql --with-big-tables --with-client-ldflags=-all-static --with-plugins=myisam,myisammrg,innobase,innodb_plugin,heap,csv,partition --with-mysqld-ldflags=-all-static" >configure1.sh

 

GCC4.4(Linux 6.2 )echo " CHOST="x86_64-pc-linux-gnu"  CFLAGS="-march=native -O3 -pipe -fomit-frame-pointer" CXX=gcc CXXFLAGS="-march=native -O3 -pipe -fomit-frame-pointer  -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock --enable-assembler --with-libwrap=/usr/lib/ --with-charset=gbk --with-extra-charsets=gb2312,gbk,big5,latin1,utf8 --with-mysqld-user=mysql --with-big-tables --with-client-ldflags=-all-static --with-plugins=myisam,myisammrg,innobase,innodb_plugin,heap,csv,partition --with-mysqld-ldflags=-all-static" >configure.sh

  www.2cto.com  

如果编译出现问题需要安装一下ncurses-devel-5.5-24.20060715.x86_64.rpm

 

#chmod x configure.sh

 

#./configure.sh

 

#make && make install

 

创建mysql用户

#groupadd mysql

#useradd -g mysql mysql

 

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

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

#cp support-files/mysqld_multi.server /etc/rc.d/init.d/mysqld_multi

 

#chmod 700 /etc/init.d/mysqld

(忽略该步)#chkconfig --add mysqld

(忽略该步)#chkconfig --level 2345 mysqld off

  www.2cto.com  

#cd /usr/local/mysql

本文由www.2003.com发布于计算机教程,转载请注明出处:www.2003.comLinux系统中安装Apache Php Mysql详细教程

关键词: