Showing category "MYSQL" (Show all posts)

How to reset user password in mysql in redhat or centos linux

Posted by Mohamed Adam on Tuesday, September 6, 2011, In : MYSQL 

How to reset user password in mysql in redhat or centos linux


Resetting the mysql user password in safemode. Lets see how to reset the password of root user in Centos / redhat linux.

Step1 : Stop the mysql service

#/etc/init.d/mysqld stop

step2 : Enter mysql safemode

#mysqld_safe --skip-grant-tables &

Step3 : Change the password

mysql> update mysql.user set password=PASSWORD("NEWPASSWORD") where User='root';

Step4 : Flush the privileges

mysql> flush privileges;

Step5 : Its over. Now you can quit.

mysql>...

Continue reading ...
 

Backing up and restoring mysql databases

Posted by Mohamed Adam on Tuesday, September 6, 2011, In : MYSQL 

Backing up and restoring mysql databases


Tacking the back up of a database
mysqldump  -u username -ppassword  database_name > database_name.sql
For example
mysqldump  -u root -pabc123 horde > horde.sql

Restoring the database
mysql database_name < database_name.sql
For example
mysql horde < horde.sql

Restart the mysql
/etc/init.d/mysqld restart

Continue reading ...
 
 

Recent Posts