Control Web Panel
WebPanel => MySQL => Topic started by: kavirajan on November 17, 2015, 12:26:18 PM
-
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.
-
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
-
Thanks a lot sucessfully changed Igor S :) :) :)
-
Any time. :)
-
This script is not working for me....
sh /scripts/mysql_pwd_reset
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:
What to do ?
-
check mysql log file
-
This script is not working for me....
you need to run it from command line (shell) and not from cwp!
-
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.