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

1 Like
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.

2 Likes
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:

thank you, 2 days with this error
and finally i have find your reply, its fixed the probleme
i think its happen because i have used remote mysql

i have just find the password with
cat /etc/cyberpanel/mysqlPassword
and i have changed it on CyberCP/CyberCP/settings.py

and now the update succeful

thank you

Good Day

How did your issue as I am having the same issue as you. I get the password when using /etc/cyberpanel/mysqlPassword

but when I go to /usr/local/CyberCP/CyberCP/settings.py (nano /usr/local/CyberCP/CyberCP/settings.py) my fily does not look the same as below.

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’: ‘’,
},go to


My code looks like

“”"
Django settings for CyberCP project.

Generated by ‘django-admin startproject’ using Django 1.11.3.

For more information on this file, see

For the full list of settings and their values, see

“”"

import os
from django.utils.translation import ugettext_lazy as _

Build paths inside the project like this: os.path.join(BASE_DIR, 
)

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(file)))

Quick-start development settings - unsuitable for production

See Deployment checklist | Django documentation | Django

SECURITY WARNING: keep the secret key used in production secret!

SECRET_KEY = ‘xr%jp!$0d%(-(e%@-*hyoz4$f%y77coq0u)6pwmjg4)q&19f’

SECURITY WARNING: don’t run with debug turned on in production!

DEBUG = True

ALLOWED_HOSTS = [‘*’]

Application definition

INSTALLED_APPS = [
‘django.contrib.admin’,
‘django.contrib.auth’,
‘django.contrib.contenttypes’,
‘django.contrib.sessions’,
‘django.contrib.messages’,
‘django.contrib.staticfiles’,
‘baseTemplate’,
‘loginSystem’,
‘packages’,

Hi Doug

I get to the section where on point 3 Check if user cyberpanel exists:" and mine do exist

mine does exist but I get the same error “(1045, “Access denied for user ‘cyberpanel’@‘localhost’ (using password: YES)”)”

On my terminal if I use

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

my info I get on the file is totally different and does not contain info as per your post

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': '',
    },

Mine has the following inside

“”"
Django settings for CyberCP project.

Generated by ‘django-admin startproject’ using Django 1.11.3.

For more information on this file, see

For the full list of settings and their values, see

“”"

import os
from django.utils.translation import ugettext_lazy as _

Build paths inside the project like this: os.path.join(BASE_DIR, 
)

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(file)))

Quick-start development settings - unsuitable for production

See Deployment checklist | Django documentation | Django

SECURITY WARNING: keep the secret key used in production secret!

SECRET_KEY = ‘xr%jp!$0d%(-(e%@-*hyoz4$f%y77coq0u)6pwmjg4)q&19f’

SECURITY WARNING: don’t run with debug turned on in production!

DEBUG = True

ALLOWED_HOSTS = [‘*’]

Application definition

INSTALLED_APPS = [
‘django.contrib.admin’,
‘django.contrib.auth’,
‘django.contrib.contenttypes’,
‘django.contrib.sessions’,
‘django.contrib.messages’,
‘django.contrib.staticfiles’,

Can you please assist as I am getting frustrated