Jump to content

How To Reset / Change DB's Password


Recommended Posts

  • Premium

Hello again dear community,

I've seen in many hosters for doing reset mysql need money ,so I'll release a way how to do it easy by your self.

Here are the commands:

/usr/local/etc/rc.d/mysql-server stop

mysqld_safe --skip-grant-tables &

mysql -u root

use mysql

update user set password=PASSWORD('yourpassword') where user='root';

flush privileges;

quit

service mysql-server restart


 

Note:Replace the password that you want with the text yourpassword and if you're using another user replace root.

Hope I've helped you , if you have any problems please let me know.

Sincerely,

Crystal

  • Metin2 Dev 1
  • Love 3
Link to comment
Share on other sites

  • Honorable Member

Just to sort it out better:

    # service mysql-server stop
    # mysqld_safe --skip-grant-tables &
    # mysql -u root
    mysql> use mysql;
    mysql> UPDATE user SET password=PASSWORD('yourpassword') WHERE user='root';
    mysql> FLUSH PRIVILEGES;
    mysql> quit
    # service mysql-server restart

  • Metin2 Dev 1
  • Love 4
Link to comment
Share on other sites

  • Premium
12 hours ago, martysama0134 said:

Just to sort it out better:

 


    # service mysql-server stop
    # mysqld_safe --skip-grant-tables &
    # mysql -u root
    mysql> use mysql;
    mysql> UPDATE user SET password=PASSWORD('yourpassword') WHERE user='root';
    mysql> FLUSH PRIVILEGES;
    mysql> quit
    # service mysql-server restart

 

Thanks master :) 

Link to comment
Share on other sites

  • Honorable Member
33 minutes ago, MichaelM said:
  Hide contents

FLUSH PRIVILEGES; 

It's not mandatory. You're not granting any kind of privilege to 'root'.

I usually needed to do so to get a total refresh of the passwords even on older sessions too.

It's not 100% necessary since we're going to restart mysql-server in the next step. (if that was your point)

  • Love 1
Link to comment
Share on other sites

  • 3 years later...
  • 2 years later...

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.