1. 关闭防火墙和selinux
- 打开文件selinux
vim /etc/sysconfig/selinux
- 将文件中SELINUX=enforcing改为disabled,然后执行”setenforce 0″不用重启地关闭 selinux
- 关闭放火墙
systemctl stop firewalld.service
2. MYSQL安装
- 下载mysql的repo源
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
- 安装mysql-community-release-el7-5.noarch.rpm包
rpm -ivh mysql-community-release-el7-5.noarch.rpm
- 安装MYSQL
sudo yum install -y mysql-server
- 更改MYSQL用户权限
sudo chown -R root:root /var/lib/mysql
- 重启服务
systemctl restart mysql.service
- 登录,并修改密码
mysql -u root
mysql > use mysql;
mysql > update user set password=password(‘123456‘) where user=‘root‘;
mysql > flush privileges;
mysql > exit;
ps:navicat远程连接MySQL会报没有权限,进入MySQL中输入以下指令
mysql>grant all privileges on . to root@'%' identified by "password";
网友评论