时间:2021-07-01 10:21:17 帮助过:26人阅读
linux mysql运维一些常用记录
//停止mysql
# service mysqld stop
//安全模式启动mysql,跳过权限检查
# mysqld_safe --user=mysql --skip-grant-tables &
//登入mysql控制台
mysql
//修改所有root的密码
mysql> update user set password=password('newpassword') where user='root';
//刷新授权
mysql> flush privileges;
//退出
mysql> quit
//重新启动mysql
# service mysqld restart
//给192.168.248.71上root 用户赋权所有数据库
mysql> grant all privileges on *.* to 'root'@'192.168.248.71' identified by 'root' with grant option;
//设置防火墙允许3306端口
# vi /etc/sysconfig/iptables
添加
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT
//重启防火墙
# service iptables restart
bitsCN.com