Linux下安装MySQL

2018-07-12  本文已影响8人  行将醒来的意识

1. 关闭防火墙和selinux

vim /etc/sysconfig/selinux

systemctl stop firewalld.service


2. MYSQL安装

wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm

rpm -ivh mysql-community-release-el7-5.noarch.rpm

sudo yum install -y mysql-server

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";

上一篇 下一篇

猜你喜欢

热点阅读