Centos7在线安装MySQL5.6

旺达泥网8个月前 (04-03)网络技术699

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


相关文章

Word2007另存转换为PDF格式方法

Word2007另存转换为PDF格式方法

     先送上下载地址:http://www.microsoft.com/zh-cn/download/details.aspx?id=7下载后安装就行,下面是步骤:第...

首次配置eclipse

代码补全        1:打开 Eclipse -> Window -> Perferences,  &n...

Java环境变量配置

新建变量名:JAVA_HOME变量值:C:\Program Files (x86)\Java\jdk1.8.0_91(Java的jdk路径)新建变量名:CLASSPATH变量值:.;%JAVA_HOM...

Putty连接VMWare中Ubuntu的问题解决

确认Ubuntu中安装并启动了ssh,方法如下:sudo apt-get install openssh-server如果没安装过ssh,那么就会安装,如果提示已经安装过了,那就接着执行:ps -e...

ubuntu更新软件库

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

ubuntu安装jdk(官网下载)

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