Heim  >  Artikel  >  Datenbank  >  linux mysql运维一些常用记录_MySQL

linux mysql运维一些常用记录_MySQL

WBOY
WBOYOriginal
2016-06-01 13:32:52817Durchsuche

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
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn