Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



How to reset mysql password?

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 23-05-2009
Member
 
Join Date: Jan 2009
Posts: 40
How to reset mysql password?
  

MySQL Server will be installed with root superuser without any password.I can connect to MySQL server as root without any password. How do i set or reset the password for mysql?

Thank you for any suggestions.

Reply With Quote
  #2  
Old 23-05-2009
Member
 
Join Date: Apr 2008
Posts: 1,946
Re: How to reset mysql password?

SET PASSWORD Syntax
Quote:
SET PASSWORD [FOR user] =
{
PASSWORD('some password')
| OLD_PASSWORD('some password')
| 'encrypted password'
}
The SET PASSWORD statement assigns a password to an existing MySQL user account. If the password is specified using the PASSWORD() or OLD_PASSWORD() function, the literal text of the password should be given. If the password is specified without using either function, the password should be the already-encrypted password value as returned by PASSWORD().
Reply With Quote
  #3  
Old 23-05-2009
Member
 
Join Date: May 2008
Posts: 2,004
Re: How to reset mysql password?

Following are the steps for resetting password in Unix environment:
  • Log on to your system as either the Unix root user or as the same user that the mysqld server runs as
  • Locate the .pid file that contains the server's process ID. The exact location and name of this file depend on your distribution, hostname, and configuration. Common locations are /var/lib/mysql/, /var/run/mysqld/, and /usr/local/mysql/data/.You can stop the MySQL server by sending a normal kill (not kill -9) to the mysqld process, using the pathname of the .pid file in the following command:
    Quote:
    shell> kill `cat /mysql-data-directory/host_name.pid`
  • Restart the MySQL server with the special --skip-grant-tables option:
    Quote:
    shell> mysqld_safe --skip-grant-tables &
  • Set a new password for the root@localhost MySQL account:
    Quote:
    shell> mysqladmin -u root flush-privileges password "newpwd"
    Replace "newpwd'' with the actual root password that you want to use.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to reset mysql password?"
Thread Thread Starter Forum Replies Last Post
Impact of AD minimum password age to password reset cmatthews18 Networking & Security 1 14-03-2012 01:33 PM
Locked out from hotmail - forgot password so cannot reset password Talishh Windows Software 9 17-01-2011 01:18 PM
Need Password Reset Disk to change password for Windows 7 Alfanumeric Operating Systems 3 11-01-2011 03:06 PM
Mysql Error : Can't connect to local mysql server through socket ' var lib mysql mysql.sock' 2 roshan45 Software Development 3 07-11-2009 08:36 PM
Reset CMOS password requires reset bios? Aditya kumar Operating Systems 2 04-08-2009 05:27 PM


All times are GMT +5.5. The time now is 03:40 AM.