Home > Database > Mysql Tutorial > body text

linux mysql运维一些常用记录_MySQL

WBOY
Release: 2016-06-01 13:32:52
Original
851 people have browsed it

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
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template