Home > Database > Mysql Tutorial > Debian 6.02 (squeeze)下编译安装 MySQL 5.5的方法_MySQL

Debian 6.02 (squeeze)下编译安装 MySQL 5.5的方法_MySQL

WBOY
Release: 2016-06-01 13:22:32
Original
969 people have browsed it

debian

bitsCN.com 环境 : Debian 6.02 (squeeze) x64
软件:MySQL 5.5.14
步骤:
1、升级系统
#apt-get update

#apt-get upgrade

#apt-get install chkconfig libpcre3-dev build-essential libssl-dev libncurses5-dev bison
2、准备软件
cmake-2.8.5、mysql 5.5.14
#wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz

#wget ftp://mirror.anl.gov/pub/mysql/Downloads/MySQL-5.5/mysql-5.5.14.tar.gz
3、安装
1)、安装 cmake
#tar zxvf cmake-2.8.5.tar.gz

#cd cmake-2.8.5/

#./configure

#make && make install
2)、添加mysql用户
groupadd mysql

useradd --shell /sbin/nologin -g mysql mysql
3)、安装mysql
#tar zxvf mysql-5.5.14.tar.gz

#cd mysql-5.5.14

#cmake /

-DCMAKE_INSTALL_PREFIX=/usr/local/mysql /

-DMYSQL_DATADIR=/usr/local/data/mysql /

-DDEFAULT_CHARSET=utf8 /

-DDEFAULT_COLLATION=utf8_general_ci /

-DEXTRA_CHARSETS=all /

-DWITH_MYISAM_STORAGE_ENGINE=1 /

-DWITH_INNOBASE_STORAGE_ENGINE=1 /

-DWITH_READLINE=1 /

-DENABLED_LOCAL_INFILE=1 /

-DMYSQL_TCP_PORT=3306

#make && make install
4)、更改安装文件夹权限
#chown -R mysql:mysql /usr/local/mysql/

#chown -R mysql:mysql /usr/local/data/mysql
5)、初始化话
#sh scripts/mysql_install_db --basedir=/usr/local/mysql/ --datadir=/usr/local/data/mysql --user=mysql
6)、复制mysql配置文件,生成启动脚本
#cp support-files/my-medium.cnf /etc/my.cnf

#cp support-files/mysql.server /etc/init.d/mysqld
7)、设置自启动
#chmod 755 /etc/init.d/mysqld

#chkconfig mysqld on
8)、设置环境变量
#nano /etc/profile
加入以下内容
export PATH=/usr/local/mysql/bin:$PATH

alias mysql_start="mysqld_safe &"

alias mysql_stop="mysqladmin
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template