mysql镜像:
http://mirrors.ustc.edu.cn/mysql-ftp/Downloads/MySQL-5.6/
步骤:
- 先卸载机器上原有的mysql文件,必须,否则安装失败
# 将结果使用 rpm -e target 移除
rpm -qa | grep -i mysql
# 全局搜索
find / -name mysql*
# yum移除
yum -y remove mysql-libs*
- 下载:
MySQL-client-5.6.45-1.el6.x86_64.rpm
MySQL-server-5.6.45-1.el6.x86_64.rpm - yum安装需要的依赖库
yum install perl -y
yum install libnuma*
- 安装server和client
rpm -ivh MySQL-server-5.6.45-1.el6.x86_64.rpm
rpm -ivh MySQL-client-5.6.45-1.el6.x86_64.rpm
- 启动数据库
service mysql start
- 密码在 cat /root/.mysql_secret, mysql -uroot -p 输入密码登录.
- 修改密码
set password for 'root'@'localhost'=password('newpass');
- 设置开启启动
chkconfig mysqld on
- iptables开放3306
iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
service iptables save
service iptables restart
- 设置root用户可以远程连接
grant all privileges on *.* to 'root'@'%' identified by 'newpass';
flush privileges;
-
目录位置
mysql: /usr/share/mysql
my.cnf: /usr/my.cnf -
卸载
rpm -e MySQL-server
rpm -e MySQL-client
网友评论