11.2 MySQL、MariaDB介绍
11.3/11.4/11.5 MySQL安装
./scripts/mysql_install_db --user=mysql --datadir=/data/mysql运行后提示,需要安装其他包,如下图:
再次运行./scripts/mysql_install_db --user=mysql --datadir=/data/mysql,
复制# cp support-files/my-default.cnf /etc/my.cnf
cp:是否覆盖"/etc/my.cnf"? n
修改/etc/my.cnf,如下图,
#cp support-files/mysql.server /etc/init.d/mysqld
# vi /etc/init.d/mysqld,如下图
设置开机启动#chkconfig --add mysqld
查看开机启动项# chkconfig --list
启动mysql,#service mysqld start或#/etc/init.d/mysqld start
扩展
mysql5.5源码编译安装 http://www.aminglinux.com/bbs/thread-1059-1-1.html
mysql5.7二进制包安装(变化较大) http://www.apelearn.com/bbs/thread-10105-1-1.html
原文地址:http://blog.51cto.com/12059818/2096315