灯火互联
管理员
管理员
  • 注册日期2011-07-27
  • 发帖数41778
  • QQ
  • 火币41290枚
  • 粉丝1086
  • 关注100
  • 终身成就奖
  • 最爱沙发
  • 忠实会员
  • 灌水天才奖
  • 贴图大师奖
  • 原创先锋奖
  • 特殊贡献奖
  • 宣传大使奖
  • 优秀斑竹奖
  • 社区明星
阅读:3788回复:0

[mysql]linux mysql运维一些常用记录

楼主#
更多 发布于:2013-06-17 11:12
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

喜欢0 评分0
游客

返回顶部