CentOs 安装 Mysql

本文源于 网上, 我只是加以验证:html

https://blog.csdn.net/czmchen/article/details/46645763mysql

https://jingyan.baidu.com/article/86fae346aa437f3c48121a5b.htmlsql

1:  安装nysql数据库

# 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

2:  启动ide

# service mysqld restart

3: 进入MySQL 并修改密码:spa

mysql -uroot
use mysql;
update user set password=password('123456') where user='root';
flush privileges;

4: 远程受权访问;.net

受权:
grant all on *.* to 'root'@'%' identified by 'password' with grant option;
//容许帐户root从任何主机链接到全部数据库(*.*)
grant all on test.* to 'user'@'%' identified by 'password' with grant option;
//容许帐户user从任何主机链接到test数据库(test.*)
flush privileges; //刷新系统受权表

5: 退出rest

exit ;
相关文章
相关标签/搜索