1. 下载 MySQL 5.5 deb 安装包
cd /usr/local/src
sudo wget -O mysql-5.5.22-debian6.0-i686.deb http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.22-debian6.0-i686.deb/from/http://mysql.ntu.edu.tw/
2. 安装 deb 包
sudo dpkg -i mysql-5.5.22-debian6.0-i686.deb
MySQL server 被初始化在 /opt/mysql/server-5.5
3. 使能 MySQL
groupadd mysql
useradd -r -g mysql mysql
sudo apt-get install libaio-dev
ln -s /opt/mysql/server-5.5 /usr/local/mysql
sudo mkdir /usr/local/mysql/data
sudo chown -R mysql. /usr/local/mysql/data
初始化数据库
sudo /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
将mysqld的启动shell程序放到系统服务目录下
sudo cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
将 mysql 的配置文件放到系统配置/etc目录下,mysql在全局作用范围要使用该配置文件
sudo cp /usr/local/mys