centos 6.9 mysql 安装配置

1、全新系统,安装mysql

yum -y install mysql mysql-server mysql-devel

2、启动mysql

service mysqld start

3、修改密码

登录
mysql -uroot

选定名为mysql的数据库
use mysql;

修改所有名为root的用户密码
update user set password=password('123456') where user='root';

退出
exit;

重新密码登录
mysql -uroot -p

4、修改远程访问权限

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

5、iptables 开端口

iptables -I INPUT -p tcp --dport 3306 -j ACCEPT

service iptables save

service iptables restart

6、设置开机启动

chkconfig mysqld on

猜你喜欢

转载自www.cnblogs.com/dwj192/p/8950490.html
今日推荐