>  기사  >  데이터 베이스  >  linux mysql运维一些常用记录_MySQL

linux mysql运维一些常用记录_MySQL

WBOY
WBOY원래의
2016-06-01 13:32:52817검색

bitsCN.com

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
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.