1 官方安装文档
http://dev.mysql.com/doc/refman/5.1/en/binary-installation.html
2 安装
shell> groupadd mysql
shell> useradd -r -g mysql mysql
shell> cd /usr/local
shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cp support-files/mysql.server /etc/init.d/mysql.server
shell> ./bin/mysqladmin -u root password 'new-password'
shell> ./bin/mysql_secure_installation
shell> ./bin/mysqld_safe --user=mysql &
3 部分命令解释
useradd -r -g mysql mysql:添加mysql用户的解释
Because the user is required only for ownership purposes, not login purposes, theuseradd command uses the -r
option to create a user that does not have login permissions to your server host