Wednesday, May 26, 2010

MYSQL Password Reset

Checking My sql version
=======================
mysql -V
mysql Ver 14.12 Distrib 5.0.86, for pc-linux-gnu (i686) using readline 5.1

Reset Mysql Password for mysql Ver 14.12

=========================================

mysql>set password for 'teachersdb_Ads'@'localhost' = password('98m4@9er');

For some other versions

=======================

UPDATE user SET Password=PASSWORD('1q2w3e4r') WHERE User=’teachersdb_Ads’;

For mysql login:
================
mysql -u username -p password

To set All privileges to My sql DB

===================================
GRANT ALL PRIVILEGES ON teachersdb_Ads.* TO teachersdb_Ads @'174.37.6.90' IDENTIFIED BY '4645bvg6dgdr'

You will start by logging into your server via ssh and logging into your MySQL entering the following:

mysql –uadmin –p`cat /etc/psa/.psa.shadow`


Grant Privilege

GRANT SELECT ON database.* TO username@'localhost' IDENTIFIED BY 'password';

To enable more options you would separate them with a comma. So to enable SELECT, INSERT, and DELETE your syntax would look like this;

GRANT SELECT, INSERT, DELETE ON database.* TO username@'localhost' IDENTIFIED BY 'password';

Once you have given the desired privileges for your user, you will need to run this command within the MySQL command prompt;

FLUSH PRIVILEGES;

To see a list of the privileges that have been granted to a specific user;

select * from mysql.user where User='user' \G

No comments:

Post a Comment