Control Web Panel
WebPanel => CentOS 7 Problems => Topic started by: thanhblog.info on May 01, 2019, 04:34:49 PM
-
My vps is have problem:
Warning: mysqli_connect(): (HY000/1049): Unknown database 'root_cwp' in /usr/local/cwpsrv/htdocs/resources/admin/include/functions.php on line 0
Warning: mysqli_connect(): (HY000/1045): Access denied for user 'postfix'@'localhost' (using password: YES) in /usr/local/cwpsrv/htdocs/resources/admin/include/functions.php on line 0
Warning: mysqli_connect(): (HY000/1045): Access denied for user 'postfix'@'localhost' (using password: YES) in /usr/local/cwpsrv/htdocs/admin/admin/index.php on line 0
Warning: mysqli_connect(): (HY000/1049): Unknown database 'root_cwp' 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: mysqli_error() expects exactly 1 parameter, 0 given in /usr/local/cwpsrv/htdocs/admin/admin/index.php on line 0
Could not connect:
Plz help me. Tks all so much!
-
** Important (as your error message itself):
===========================================================================================
**Check your MySQL root password in: /usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php and /root/.my.cnf
===========================================================================================
This means the root password in file:
/usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php
and in the file:
/root/.my.cnf
must be exactly the same.
Check that.
Regards,
Netino
-
root password is same, but this not action. Can you help me! Tks
-
Hello.
Try to check if MySQL server is active and has root_cwp database.
-
I had the same issue , this code saved me.
login using SSH and paste the code:
# systemctl stop mysqld
#systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"
# systemctl start mysqld
i hope it works for you :)
-
I had the same issue , this code saved me.
login using SSH and paste the code:
# systemctl stop mysqld
#systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"
# systemctl start mysqld
i hope it works for you :)
Never do things like that!!!
-
Here is a post on stack exchange about doing this to regain access to root user account...
How to re-take control of the root user in MySQL.
DANGER: RISKY OPERATTION
Start session ssh (using root if possible).
Edit my.cnf file using.
sudo vi /etc/my.cnf
Add line to mysqld block.*
skip-grant-tables
Save and exit.
Restart MySQL service.
service mysql restart
Check service status.
service mysql status
Connect to mysql.
mysql
Using main database.
use mysql;
Redefine user root password.
UPDATE user SET `authentication_string` = PASSWORD('myNuevoPassword') WHERE `User` = 'root';
Edit file my.cnf.
sudo vi /etc/my.cnf
Erase line.
skip-grant-tables
Save and exit.
Restart MySQL service.
service mysqld restart
Check service status.
service mysql status
Connect to database.
mysql -u root -p
Type new password when prompted.
This action is very dangerous, it allows anyone to connect to all databases with no restriction without a user and password. It must be used carefully and must be reverted quickly to avoid risks.
-
Hi, just run the next two commands if you'd like to change the MySQL root password:
/scripts/mysql_pwd_reset
cat /root/.my.cnf