1. 下载
或者使用wget下载:
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-5.6.22-1.el6.i686.rpm-bundle.tar
2. 安装
3. tar -xvf mysql-5.7.30-1.el6.i686.rpm-bundle.tar -C /usr/local/src/mysql //解压到指定目录
4. 安装server: rpm -ivh mysql-community-server-5.7.30-1.el6.i686.rpm
安装依赖:yum -y install libaio.so.1 libgcc_s.so.1 libstdc++.so.6
5.安装client
6.查询mysq服务运行状态
7 .启动mysql服务
service mysql start8.使用root账号登录mysql
在安装mysql server时有句提示:
- 注意:这个密码是不安全的,所有需要修改初始密码。
- 使用密码登录mysql账号:mysql -uroot -p
- 修改root密码:SET PASSWORD = PASSWORD('123456')
系统启动时自动启动mysql服务
加入到系统服务:
chkconfig --add mysql
自动启动:
chkconfig mysql on
查询列表:
chkconfig
说明:都没关闭(off)时是没有自动启动。
登录:
mysql -uroot –p123456
设置远程访问(使用root密码):
grant all privileges on *.* to 'root' @'%' identified by '123456';
flush privileges;
防火墙打开3306端口
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
/etc/rc.d/init.d/iptables save 永久保存
/etc/init.d/iptables status