1, 从mysql网站下载deb包
http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.15-debian6.0-x86_64.deb
2, 安装
sudo dpkg -i mysql-5.6.15-debian6.0-x86_64.deb
3,配置
sudo groupadd mysql
sudo useradd -r -g mysql mysql
sudo apt-get install libaio-dev
sudo ln -s /opt/mysql/server-5.6 /usr/local/mysql
sudo mkdir /usr/local/mysql/data
sudo chown -R mysql. /usr/local/mysql/data
添加errmsg.sys
> sudo mkdir /usr/share/mysql
> sudo cp /opt/mysql/server-5.6/share/english/errmsg.sys /usr/share/mysql/
> sudo chown -R mysql. /usr/share/mysql
> sudo chown -R mysql. /usr/share/mysql/errmsg.sys
初始化数据库
> 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/mysql/support-files/my-default.cnf /etc/my.cnf
遇到启动失败“Starting MySQL * Couldn‘t find MySQL server (/usr/bin/mysqld_safe)”时
> sudo rm /etc/mysql/my.cnf
或者
> sudo ln -s /opt/mysql/server-5.6/bin/mysqld_safe /usr/bin/mysqld_safe 这样的话,系统将会变成使用/etc/mysql/my.cnf配置文件
启动/停止 Mysql
> sudo /etc/init.d/mysql start
> sudo /etc/init.d/mysql stop
修改root密码
sudo /usr/local/mysql/bin/mysqladmin -u root password abc