Access denied for user 'cyberpanel'@'localhost' (using password: YES)

the username and password is correct for cyberpanel user in
CyberCP/CyberCP/settings.py file

Please help

try Mysql Host localhost:3307

You need to update the password for cyberpanel user.

Extract your current database password from:

/etc/cyberpanel/mysqlPassword

Use the password to login using below command:

mysql --host=127.0.0.1 --port=3307 -u root -p

Must use this command, because on port 3306 there is another instance of MYSQL running, which does not host cyberpanel database. Then follow the normal procedure to update password for user cyberpanel

Thank u usmannasir

I did the same thing with the default port 3306 I didnt thought it was using the another instance of mariadb.

thanks again.

You need to update the password for cyberpanel user.

Extract your current database password from:

/etc/cyberpanel/mysqlPassword

Use the password to login using below command:

mysql --host=127.0.0.1 --port=3307 -u root -p

Must use this command, because on port 3306 there is another instance of MYSQL running, which does not host cyberpanel database. Then follow the normal procedure to update password for user cyberpanel

I had change password username cyberpanel but can’t login to cyperpanel.

Support too slow

Support too slow

I believe that you have messed up with passwords and not updated the CyberPanel settings file accordingly.

Settings file is located at: /usr/local/CyberCP/CyberCP/settings.py

There you can update the correct password for CyberPanel database, if you create ticket I will have a look for you, and this would be much simpler in finding out what is the root cause of this.

Support too slow

I believe that you have messed up with passwords and not updated the CyberPanel settings file accordingly.

Settings file is located at: /usr/local/CyberCP/CyberCP/settings.py

There you can update the correct password for CyberPanel database, if you create ticket I will have a look for you, and this would be much simpler in finding out what is the root cause of this.

I really change password and config correct at: /usr/local/CyberCP/CyberCP/settings.py

But it’s not working.

Please help me!

I sent the ticket two days ago but still no response.

Please check the ticket and help me.

Thanks

Support too slow

I believe that you have messed up with passwords and not updated the CyberPanel settings file accordingly.

Settings file is located at: /usr/local/CyberCP/CyberCP/settings.py

There you can update the correct password for CyberPanel database, if you create ticket I will have a look for you, and this would be much simpler in finding out what is the root cause of this.

I really change password and config correct at: /usr/local/CyberCP/CyberCP/settings.py

But it’s not working.

Please help me!

I sent the ticket two days ago but still no response.

Please check the ticket and help me.

Thanks

The password that you used in the settings file was the password for root user for MySQL running at port 3307.

I’ve updated settings file to use root user, you need to log into your database running at port 3307 using this command:

mythe sql --host=127.0.0.1 --port=3307 -u root -p

and change password for cyberpanel user, and then update settings file and do:

systemctl restart gunicorn.socket

For now, CyberPanel should be back and running.

Support too slow

I believe that you have messed up with passwords and not updated the CyberPanel settings file accordingly.

Settings file is located at: /usr/local/CyberCP/CyberCP/settings.py

There you can update the correct password for CyberPanel database, if you create ticket I will have a look for you, and this would be much simpler in finding out what is the root cause of this.

I really change password and config correct at: /usr/local/CyberCP/CyberCP/settings.py

But it’s not working.

Please help me!

I sent the ticket two days ago but still no response.

Please check the ticket and help me.

Thanks

The password that you used in the settings file was the password for root user for MySQL running at port 3307.

I’ve updated settings file to use root user, you need to log into your database running at port 3307 using this command:

mythe sql --host=127.0.0.1 --port=3307 -u root -p

and change password for cyberpanel user, and then update settings file and do:

systemctl restart gunicorn.socket

For now, CyberPanel should be back and running.

Thanks a lot bro!

After change must restart socket to work.

systemctl restart gunicorn.socket

I also have this problem, after upgrading version 2.0.1, the cyberpanel dashboard is not accessible with messsage “Server Error (500)”. I have also update the password of user “cyberpanel” and update in /usr/local/CyberCP/CyberCP/settings.py but it’s not working now.

latest output of “journalctl -xe” below:

Jun 29 19:06:23 xxx pdns_server[11691]: About to create 3 backend threads for UDP
Jun 29 19:06:23 xxx pdns_server[11691]: gmysql Connection failed: Unable to connect to database: ERROR 1045 (28000): Access denied for user ‘cyberpanel’@‘localhost’ (using password: YES)
Jun 29 19:06:23 xxx pdns_server[11691]: Caught an exception instantiating a backend: Unable to launch gmysql connection: Unable to connect to database: ERROR 1045 (28000): Access denied for user ‘cyberpanel’@‘localhost’ (using password: YES)
Jun 29 19:06:23 xxx pdns_server[11691]: Cleaning up
Jun 29 19:06:23 xxx pdns_server[11691]: Distributor caught fatal exception: Unable to launch gmysql connection: Unable to connect to database: ERROR 1045 (28000): Access denied for user ‘cyberpanel’@‘localhost’ (using password: YES)
Jun 29 19:06:23 xxx systemd[1]: pdns.service: main process exited, code=exited, status=1/FAILURE
Jun 29 19:06:23 xxx systemd[1]: Unit pdns.service entered failed state.
Jun 29 19:06:23 phpmyadmin.hungviet-at.vn systemd[1]: pdns.service failed.

I am install Cyberpanel
Tell me how to give Permission User in Database get error Access denied for user ‘hoat_user’@‘localhost’ (using password: YES)

Please help me How to give grand permission to user

Lets sum this up with one additional explanation to solve this problem:

  1. You need to update the password for cyberpanel user.

Extract your current database password from:

/etc/cyberpanel/mysqlPassword
  1. Use the password to login using below command:
mysql --host=127.0.0.1 --port=3307 -u root -p

Then:
3. Check if user cyberpanel exists:

SELECT user, host FROM mysql.user;

Example result:

±------------±---------------------+
| User | Host |
±------------±---------------------+
| | centos-79-64-minimal |
| | localhost |
| cyberpanel | localhost |
| mariadb.sys | localhost |
| mysql | localhost |
| root | localhost |
±------------±---------------------+
7 rows in set (0.001 sec)

If cyberpanel user don’t exist, create it:

CREATE USER 'cyberpanel'@'localhost' IDENTIFIED BY 'YourCyberpanelDatabaseUserpassword';
GRANT ALL privileges ON `cyberpanel`.* TO 'cyberpanel'@localhost IDENTIFIED BY 'YourCyberpanelDatabaseUserpassword';

This “cyberpanelUserPassword” you can find in :

/usr/local/CyberCP/CyberCP/settings.py (nano /usr/local/CyberCP/CyberCP/settings.py)

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'cyberpanel',
        'USER': 'cyberpanel',
        'PASSWORD': 'YourCyberpanelDatabaseUserpassword',
        'HOST': 'localhost',
        'PORT':''
    },
    'rootdb': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'mysql',
        'USER': 'root',
        'PASSWORD': 'YourRootMysqlPass',
        'HOST': 'localhost',
        'PORT': '',
    },
  1. To apply assigned permisions:
mysql> FLUSH PRIVILEGES;

I hope this solves everyone’s problems with this, and I documented it as I solve it for myself. Regards. :slight_smile: