Liunx CentOS7.2 安装mysql5.6.44(懒人方式)

rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm  #下载rpm文件
yum repolist enabled | grep "mysql.*-community.*" 
yum -y install mysql-community-server
systemctl enable mysqld  #开机启动
systemctl start mysqld   #启动mysql
mysql_secure_installation 设置mysql密码

mysql -u root -h 127.0.0.1 -p #进行登录 首次登陆需要本机验证登陆

update user set host = '%' where user = 'root';#设置root用户
grant all privileges on *.* to root@'xxx.xxx.xxx.xxx' identified by '密码';#运行任何服务器root用户访问数据库
FLUSH PRIVILEGES; # 最后提交

# 注意 阿里云上 的安全组 需要开放3306端口,否则连不上mysql   直接telnet ip 3306 就知道是不是安全组的问题

发布了6 篇原创文章 · 获赞 0 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/zhang199563/article/details/93376802