Search code examples
phpuser-interfaceframeworksatk4

Agile Toolkit 4 (ATK4) database connection failed


I'm trying to get the examples to work in Agile Toolkit, but I get the database connection failed error. I created a MySQL database, imported the schema.sql file, and updated the config.php file with the correct database name, database username, and password.

Here's the DSN line in config.php (fake username:password substituted)

$config['dsn']='mysql://admin123:pw12345@localhost/ATKexample';

It seems to be pointing to the right place, because the error changes if I put the wrong password into config.php. The first error message below is what I get with the correct password, and the second one below is what I get if I use an incorrect password.

PDO error: SQLSTATE[42000] [1044] Access denied for user 'admin123'@'localhost' to database 'ATKexample'

PDO error: SQLSTATE[28000] [1045] Access denied for user 'admin123'@'localhost' (using password: YES)

I can't figure out what I'm doing wrong. I don't know if it is a problem with the way the MySQL database is setup or if I need to change something in my ATK example files. Can anyone suggest a troubleshooting strategy?

Edit: I didn't have my user privileges setup right in MySQL. Problem solved.


Solution

  • Log into your mysql console and grant permissions for user admin123

    grant all on `ATKexample`.* to 'admin123'@'localhost' identified by 'pw12345';