I was installing WHMCS on my wamp localhost but it required a password for the database which is blank by default, so I went in to phpmyadmin and added a password. Whenever I try to connect the database now I just get this error. Could not connect to database server: SQLSTATE[HY000] [1045] Access denied for user 'test'#'localhost' (using password: YES)
Screenshot of the installation page and error
Related
I am getting this error. In codeigniter 2.1.3
Connection failed: Access denied for user 'root'#'localhost' (using password: YES)
I have tried hard.
I have done restart Apache and MySQL.
Tried with adding ip as hostname.
Have edited my.cnf file.
From root user, I can execute this command without any problems:
[root#freebsd ~/var/html/www]$ bin/console d:run-sql 'SELECT * from user';
From www user, I cannot execute this command:
[www#freebsd ~/var/html/www]$ bin/console d:run-sql 'SELECT * from user';
because I am getting the following error:
An exception occurred in driver: SQLSTATE[HY000] [2002] Permission denied
Both users are using the same config file:
parameters:
database_driver: "pdo_mysql"
database_url: "mysql://dbuser:dbuserpass#127.0.0.1:3306/dbname"
I am using MariaDB 10.4 which is running on Freebsd with PHP(Symfony project)
Authentication problems comes with an access denied message.
A permission denied error means that you authentication happened but the resource you're trying to access was denied. Probably the dbname database.
You need to grant at least a "select" permission to this user with root or another administrator user:
GRANT SELECT ON dbname.* TO dbuser#127.0.0.1;
Pay attention because with mysql client if we don't specify a host or specify it like localhost instead of 127.0.0.1, the client tries to connect trought unix socket.
You can overcome this with --protocol tcp or using a IP address.
I have my .env file configured with the remote DB credentials and its working on my local computer.
When I deploy the app to our dev server in the same page returns
SQLSTATE[HY000] [1045] Access denied for user 'homestead'#'localhost' (using password: YES) (SQL: select * from `table_companies`)
Is there a command that I'm missing? Why if my .env us using our cloudways database credentials is saying homestead'#'localhost?
The production server has its own DB credentials that you should put in server's own .env file.
For my Symfony2 project, I'm using Propel with MySQL.
When I deployed it on a server and ran:
php app/console propel:database:create --env=prod
I got this error:
[Propel] Exception caught
Unable to open PDO connection [wrapped: SQLSTATE[28000] [1045] Access denied for user 'user'#'localhost' (using password: YES)]
Which is really weird because when I run MySQL CLI with exactly the same host, user and password it works fine.
$ mysql -h localhost -u user -p
Propel-bundle: 1.2.13
What's going on?
Try these steps
Configure config/databases.yml with the working username and password. Ensure you are using the correct password and port here
propel:
class: sfPropelDatabase
param:
classname: PropelPDO
dsn: 'mysql:dbname=your-database-name;host=localhost'
port : 3306
username: user
password : your-password
encoding: utf8
persistent: true
pooling: true
Disable SELnux: If SELinux is enabled which can block the connection. Try to disable that, although not the optimal for those that like of security on their systems
I am facing one problem on xampp
1045 - Access denied for user 'root'#'localhost' (using password: YES)
I have changed the password on the Config.inc file, but this doesn't resolved the issue.
I have the same problem with you, but I have resolved it.
I think you have input your default root password, we can't do it.
If you want to enter the mariadb, you should run mysql_secure_installation first to create your account for mariadb, and next run mysql -uroot -p 'your password'