Database Migration Failure

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
summer
Posts: 1
Joined: 11 Mar 2021, 08:35

Database Migration Failure

Post by summer » 11 Mar 2021, 08:38

Hi guys, I get this exception every time I migrate the DB
Illuminate\Database\QueryException : SQLSTATE[HY000] [1045] Access denied for user 'dev'@'localhost' (using password: NO) (SQL: select * from information_schema.tables where table_schema = nyotsong and table_name = migrations and table_type = 'BASE TABLE')

at D:\NyoTsong videos\test11\myshop\vendor\laravel\framework\src\Illuminate\Database\Connection.php:669
665| // If an exception occurs when attempting to run a query, we'll format the error
666| // message to include the bindings with SQL, which will make this exception a
667| // lot more helpful to the developer instead of just the database's errors.
668| catch (Exception $e) {
> 669| throw new QueryException(
670| $query, $this->prepareBindings($bindings), $e
671| );
672| }
673|

Exception trace:

1 Doctrine\DBAL\Driver\PDO\Exception::("SQLSTATE[HY000] [1045] Access denied for user 'dev'@'localhost' (using password: NO)")
D:\NyoTsong videos\test11\myshop\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDO\Exception.php:18

2 Doctrine\DBAL\Driver\PDO\Exception::new(Object(PDOException))
D:\NyoTsong videos\test11\myshop\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:42

User avatar
aimeos
Administrator
Posts: 7941
Joined: 01 Jan 1970, 00:00

Re: Database Migration Failure

Post by aimeos » 12 Mar 2021, 08:06

Your database doesn't accept connections from user "dev" without password. Add a user with a password to your MySQL server and set the user/password in your Laravel .env file in the application root directory:

Code: Select all

ALTER USER 'dev'@'localhost' IDENTIFIED BY 'secret';
GRANT ALL ON *.* TO 'dev'@'localhost';
See also:
- https://dev.mysql.com/doc/refman/8.0/en/alter-user.html
- https://dev.mysql.com/doc/refman/8.0/en/grant.html
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply