Mysql change root password

Started by kavirajan, November 17, 2015, 12:26:18 PM

Previous topic - Next topic

kavirajan

Hi Team,

Just Now installed CWP and working charm. But I need to set the Mysql password from my end. If we run this command sh /scripts/mysql_pwd_reset password set randomly.

But I need to set password my end. can anyone help me.

Igor S.

Hello.

Use next:
service mysqld stop
killall -vw mysqld
mysqld_safe --skip-grant-tables  &


mysql -e "UPDATE mysql.user SET Password=PASSWORD('DB_ROOT_PASS') WHERE user='root'"
where DB_ROOT_PASS is new root password

mysql -e "FLUSH PRIVILEGES"
service mysqld restart


next step you have to change configuration files and set your new password here:


1. /usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php
2. /root/.my.cnf




You can ask me to solve any problem with your server for some money in pm  ;)






Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor


Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp

Installation Instructions
http://centos-webpanel.com/installation-instructions

Get Fast Support Here
http://centos-webpanel.com/support-services

kavirajan

Thanks a lot sucessfully changed Igor S :) :) :)

Igor S.




You can ask me to solve any problem with your server for some money in pm  ;)






Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor


Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp

Installation Instructions
http://centos-webpanel.com/installation-instructions

Get Fast Support Here
http://centos-webpanel.com/support-services

Jisjo

This script is not working for me....
Quotesh /scripts/mysql_pwd_reset
Quote
Warning:  [obfuscated](): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in /usr/local/cwpsrv/htdocs/admin/admin/index.php on line 0


Trying to start mysql server, please wait!
Try to restart CentOS Web Panel with command: sh /scripts/restart_cwpsrv


**Check your MySQL root password in: /usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php and /root/.my.cnf


Warning:  [obfuscated]() expects exactly 1 parameter, 0 given in /usr/local/cwpsrv/htdocs/admin/admin/index.php on line 0
Could not connect:
Quote
What to do ?

Sandeep


Administrator

Quote from: Jisjo on April 20, 2017, 10:31:32 AM
This script is not working for me....

you need to run it from command line (shell) and not from cwp!

bupet

just for the record changes can be reverted.

yum history list

if you had removed it will say one will say "Erased" in the list with an id to the left.
It will look like this including the date.
This is the id--> 14 | root <root>              | 2018-08-26 06:32 | Erase          |    5

so just run this :
yum history rollback [id]
So for my example the command would be :

yum history rollback 14

this will undo the erase/remove.