1,检查系统中是否已有Mysql: netstat –ano命令查看mysql默认端口3306是否存在;或者再命令行中执行mysql.
2 ,下载安装:http://www.mysql.com/downloads/mysql/#downloads,下载:
MySQL-client-5.6.26-1.linux_glibc2.5.x86_64.rpm
MySQL-server-5.6.26-1.linux_glibc2.5.x86_64.rpm
使用rpm –ivh命令来安装mysql:
rpm -ivh MySQL-server-5.6.26-1.linux_glibc2.5.x86_64.rpm --replacefiles
3,启动与停止:
cd /etc/rc.d/init.d
./mysql start
关闭:./mysql stop
3,报错处理:
3.1: 错误:Starting MySQL..... ERROR! The server quit without updating PID file; 解决1:mv /etc/my.cnf /etc/my.cnf.backup 详情. 解决2:用命令“ps -ef|grep mysqld”查看是否有mysqld进程,如果有使用“kill -9 进程号”杀死,然后重新启动mysqld! 详情
4,设置自启动:
4.1 察看mysql是否在自动启动列表中
/sbin/chkconfig --list
4.2 添加和删除自启动
/sbin/chkconfig -- add mysql
/sbin/chkconfig -- del mysql