CentOS 7安装mysql

前端之家收集整理的这篇文章主要介绍了CentOS 7安装mysql前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

CentOS 7的yum源中貌似没有正常安装MySQL时的MySQL-sever文件,需要去官网上下载

#wgethttp://dev.MysqL.com/get/MysqL-community-release-el7-5.noarch.rpm
#rpm-ivhMysqL-community-release-el7-5.noarch.rpm
#yuminstallMysqL-community-server

成功安装之后重启MysqL服务

#serviceMysqLdrestart

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

设置密码的方法

# MysqL -uroot

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

MysqL> exit

搞定!

远程授权连接MysqL

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;

FLUSH PRIVILEGES;

猜你在找的CentOS相关文章