当前位置:首页 > 网络技术 > 正文内容

Centos7在线安装MySQL5.6

旺达泥网10个月前 (04-03)网络技术783

1.rpm下载mysql包

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

2.安装mysql和mysql服务

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

    yum -y install mysql-server



3.检查是否安装成功

#启动MySQL

systemctl start mysqld

#查看MySQL状态

systemctl status mysqld

#出现绿色的Active:active(running)

4.给root用户添加密码

        mysqladmin -u root password "111111"


5.登录MySQL


        mysql -u root -p


6.远程登陆mysql

需要给mysql的root用户添加权限,这里需要在mysql的界面内输入

    grant all privileges on *.* to 'root'@'%' identified by '111111' with grant option;


7.mysql远程登录使用的是3306端口,所以防火墙也要开启相应的端口


[root@localhost ~]# firewall-cmd --add-port=3306/tcp --permanent
success
[root@localhost ~]# systemctl restart firewalld
[root@localhost ~]# firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens33
  sources:
  services: dhcpv6-client ssh
  ports: 3306/tcp
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:







记住修改下时区



#查看时区

timedatectl


#修改时区+8

timedatectl set-timezone Asia/Shanghai


扫描二维码推送至手机访问。

版权声明:本文由旺达泥网发布,如需转载请注明出处。

本文链接:http://www.wangdani.cn/post/6350.html

分享给朋友:

“Centos7在线安装MySQL5.6” 的相关文章

首次配置eclipse

代码补全        1:打开 Eclipse -> Window -> Perferences,        2:找到Java 下的 Edit...

Ubuntu首次使用设置root密码

一、默认密码Ubuntu的默认root密码是随机的,即每次开机都有一个新的root密码。我们可以在终端输入命令 sudo passwd,然后输入当前用户的密码,enter,//下面可不看二、设置密码sudo passwd root[sudo] password for you :–> 输入你的...

Ubuntu Server安装桌面ubuntudesktop

    更新软件库        apt-get update升级软件库        apt-ge...

ubuntu安装配置nginx

首先我们需要安装一下nginx,命令如下:sudo apt-get install nginx 安装完成之后,我们先检查一下nginx的版本,看下是否安装成功nginx -v安装成功后,我们进入nginx的目录下cd /etc/nginx/ 我们进入今后可以通过ls命令看下下面有...

ubuntu更新软件库

sudo apt-get updatesudo apt-get install...

ubuntu安装jdk(官网下载)

1:先去官网下载jdk linux版本的。https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html2:解压       ...