MySQL turned the connection away at the very first step, before your database was even touched. In PHP applications the message usually reads:
SQLSTATE[HY000] [1045] Access denied for user 'cpuser_shop'@'localhost' (using password: YES)
WordPress hides it behind Error establishing a database connection.
Reading the message
'cpuser_shop'@'localhost': the username that reached the server and the host it connected from. Check the name is complete.using password: YES: a password was sent but it’s wrong, or the user doesn’t exist.using password: NO: no password was sent, so the variable is probably empty or not loaded.
Causes
- Wrong password, or you changed it in cPanel without updating the config.
- Username without the account prefix:
shopinstead ofcpuser_shop. - The user doesn’t exist, for example after a migration where it wasn’t recreated.
- Wrong host: an external address instead of
localhost. - A password containing
#in.envwithout quotes, so everything after#is read as a comment. - Laravel still using cached config.
- Trying to log in as
rooton shared hosting.
How to fix it
- Open cPanel → Databases → MySQL Databases and copy the user’s full name from Current Users.
- Click Change Password next to it, create a strong one with the password generator, and save it.
- Under Add User To Database, pick the user and the database, click Add, tick ALL PRIVILEGES and press Make Changes.
- Update your site’s settings. For Laravel, in
.env:
DB_HOST=localhost
DB_DATABASE=cpuser_shop
DB_USERNAME=cpuser_shop
DB_PASSWORD="your#strong-password"
For WordPress, in wp-config.php:
define( 'DB_NAME', 'cpuser_shop' );
define( 'DB_USER', 'cpuser_shop' );
define( 'DB_PASSWORD', 'your#strong-password' );
define( 'DB_HOST', 'localhost' );
- In Laravel, clear the config cache after every change:
php artisan config:clear
- If you have SSH, test the login directly:
mysql -u cpuser_shop -p -h localhost cpuser_shop
If this works but the site doesn’t, the problem is in your config file, not the user.
On your own server
Outside cPanel you create the user and grant privileges in SQL:
CREATE USER 'shop_user'@'localhost' IDENTIFIED BY 'strong-password';
GRANT ALL PRIVILEGES ON shop_db.* TO 'shop_user'@'localhost';
FLUSH PRIVILEGES;
On cPanel, always create users through the interface: cPanel tracks them and adds the prefix for you.
Prevention
- Store each database’s credentials in a password manager when you create it.
- When you change a password in cPanel, update the config at the same moment.
- Quote passwords that contain symbols in
.env.
On ArabyHost
Databases run on MariaDB/MySQL with phpMyAdmin, and cPanel opens with one click from the Araby Panel. Database and user names carry your account prefix, like user_dbname, and the host is localhost. The full create-and-connect steps are in the MySQL database guide. If the error persists, ask the Araby AI assistant in the panel; it reads your error log and explains the cause. You can also browse the help center.
FAQ
What's the difference between error 1045 and 1044?
1045 means the login itself failed because of the username, password or host. 1044 means the login worked but the user has no rights on that database; fix it by adding the user to the database.
What does using password: NO mean?
Your app sent no password at all. Check that DB_PASSWORD exists and is being read, and in Laravel clear the config cache with php artisan config:clear.
Can I use the root user on shared hosting?
No. Shared hosting has no root access; you create a dedicated user for each database in cPanel and add it to that database.