1.安装版本MySQL-5.6.25-1.el6.x86_64.rpm-bundle.tar
2.用xftp上传到linux服务器 /usr/local/src/mysql/
3.查看系统自带的mysql ,并卸载
[root@localhost2 ~]# rpm -qa | grep mysql
mysql-libs-5.1.71-1.el6.x86_64
[root@localhost2 ~]# rpm -e --nodeps mysql-libs-5.1.71-1.el6.x86_64
[root@localhost2 ~]# rpm -qa | grep mysql
[root@localhost2 ~]#
4.解压mysql
tar -xvf MySQL-5.6.25-1.el6.x86_64.rpm-bundle.tar -C ./mysql/
5.安装server和client
rpm -ivh MySQL-server-5.6.25-1.el6.x86_64.rpm
rpm -ivh MySQL-client-5.6.25-1.el6.x86_64.rpmw
6.起动mysql,查看是否起动
service mysql status
service mysql status
7.设置开机自动启动mysql:
chkconfig --add mysql
chkconfig mysql on
6.防火墙放行3306端口
[root@localhost2 ~]# /sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
[root@localhost2 ~]# /etc/rc.d/init.d/iptables save
iptables:将防火墙规则保存到 /etc/sysconfig/iptables: [确定]
[root@localhost2 ~]#
--登录mysql
1.查看原始默认密码
[root@localhost2 ~]# cat /root/.mysql_secret
# The random password set for the root user at Mon Aug 27 09:15:27 2018 (local time): yce4dJue8GjRQgFX
[root@localhost2 ~]#
2.登录
[root@localhost2 ~]# mysql -u root -p
mysql>
3.修改密码:
set password = password('123456');
|
|