I am working an a DJANGO web application that is going to be running locally only. But I would like to make it connect to my CPANEL database so that I can monitor every transaction without accessing that PC.
I tried connecting as shown below
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'db_name',
'USER': 'user_name',
'PASSWORD': 'user_password',
'HOST': 'localhost',
'PORT': '3306',
'OPTIONS': {
'sql_mode': 'STRICT_ALL_TABLES',
}
}
}
I have created the database and the user in MySql Database in my CPANEL and I granted the user all previliges.
But still when I try to run the software (web application) I get this error:
django.db.utils.OperationalError: (1045, "Access denied for user 'user_name'@'localhost' (using password: YES)")
now some will say change the HOST from localhost to the server's name or IP address, I tried the public IP @ but didn't work and regarding the server's name it is
Server: Localhost via UNIX socket
Any Idea?