Reset the root password for MySQL

Source: Internet
Author: User

Reset the root password for MySQL

#/etc/init.d/mysql Stop
Shutting down MySQL. [OK]
# ps-ef |grep MySQL
Root 25174 24030 0 04:53 pts/0 00:00:00 grep mysql
# Mysqld_safe--skip-grant-tables&
[1] 25175
# 130109 04:53:27 mysqld_safe Logging to '/var/lib/mysql/webv01.err '.
130109 04:53:27 Mysqld_safe starting mysqld daemon with databases From/var/lib/mysql

# MySQL
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 1
Server Version:5.5.29-log MySQL Community Server (GPL)

Copyright (c), Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.

Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.

mysql> use MySQL;
Database changed

Mysql>update User Set Password=password ("Pwdhere") where user= "root";

Mysql>flush privileges;


#/etc/init.d/mysql Stop

#/etc/init.d/mysql Start

# mysql-u Root-p

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.