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 ;
相關文章
相關標籤/搜索