Centos7安装mysql

1.下载安装MySql
# 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

设置方法(例:密码为root)

# mysql -uroot
mysql> set password for ‘root’@‘localhost’ = password('root');
mysql> exit

配置远程授权连接mysql

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

 

posted @ 2017-02-27 15:55  惜笑  阅读(179)  评论(0编辑  收藏  举报