当前位置:首页 > 开发 > 操作系统 > 正文

CentOS-7 安装mysql

发表于: 2015-07-14   作者:dk05408   来源:转载   浏览:
摘要: # wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm # rpm -ivh mysql-community-release-el7-5.noarch.rpm # yum install mysql-community-server 成功安装之后重启mysql服务 # service mysqld r

# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

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

# yum install mysql-community-server

成功安装之后重启mysql服务

# service mysqld restart

初次安装mysql是root账户是没有密码的

设置密码的方法

# mysql -uroot

mysql> set password for ‘root’@‘localhost’ = password('mypasswd');

mysql> exit

 

关闭防火墙

[root@localhost Desktop]# systemctl stop firewalld.service

[root@localhost Desktop]# systemctl status firewalld.service

[root@localhost Desktop]# systemctl disable firewalld.service

 

查询配置

vim /etc/my.cnf

 

show databases;

use mysql;

select * from user;

CentOS-7 安装mysql

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号