Home > Database > Mysql Tutorial > body text

mysql找还root密码

WBOY
Release: 2016-06-07 16:25:26
Original
932 people have browsed it

mysql找回root密码 ==========================》修改root密码 1、关闭mysql服务 killall -TERM mysqld 2、修改配置文件 vi /etc/my.cnf 在[mysqld]的段中加上一句:skip-grant-tables 例如: [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.s

mysql找回root密码
==========================》修改root密码
1、关闭mysql服务
killall -TERM mysqld


2、修改配置文件
vi /etc/my.cnf


在[mysqld]的段中加上一句:skip-grant-tables


例如:


[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-grant-tables


3、重启mysqld
service mysqld restart


4、登录
mysql -uroot -p


5、修改密码
update mysql.user set password=PASSWORD('111111') where user='root';
flush privileges;//刷新权限


==========================》修改root密码
1、修改配置文件
 vi /etc/my.cnf
 去掉之前的改动


2、重启服务


3、设置远程用户
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!