Jump to content
  • 0

How to change MySQL Password/phpmyadmin Linux


Dev Blaze

Question


  • Group:  Members
  • Topic Count:  68
  • Topics Per Day:  0.02
  • Content Count:  212
  • Reputation:   5
  • Joined:  01/24/12
  • Last Seen:  

If this is the first time you have logged into your server through this manner, you will be prompted to accept the identification of this server. Once you do this and are logged in, perform the following commands to reset the administrator password.

Step.1

#service mysqld stop

phyton_zpsc0beafaa.png

Step.2

#/usr/bin/mysqld_safe --skip-grant-tables &

phyton_zpsb6925c23.png

This starts the MySQL daemon in the background and skips the authentication mechanisms.

Step.3

#mysq

 

phyton_zps83864ece.png
 

Step.4

#use mysql;

phyton_zps863c4b08.png

Step.5

#update user set password=password('newpassword') where user='root' and host='localhost';

phyton_zps67d3af49.png

Step.6

#flush privileges;

phyton_zps95f0cf87.png

Step.7

#quit

phyton_zpsa0aaf6fc.png

Step.8

#service mysqld stop

phyton_zpsbb4647e9.png

Step.9

#service mysqld start

phyton_zpsec74b446.png

Step.10

#exit

Untitled_zpsf2c76b6f.png

Dev Blaze ™ 

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  66
  • Reputation:   6
  • Joined:  11/13/12
  • Last Seen:  

Actually, If you have never set a root password for MySQL server, the server does not require a password at all for connecting as root. To setup root password for first time, use mysqladmin command at shell prompt as follows:

 

mysqladmin -u root password NEWPASSWORD

However, if you want to change (or update) a root password, then you need to use the following command:

mysqladmin -u root -p'oldpassword' password newpass

Source: Nixcraft

Edited by ccjosh
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  707
  • Reputation:   168
  • Joined:  01/26/12
  • Last Seen:  

Hi D3vBlaze,

ccjosh's method is correct for changing MySQL account passwords; your method is only if the user absolutely forgets his password and has no access to SQL, which is why it requires to be run on safe mode.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...