Jump to content
Sign in to follow this  


Recommended Posts

Posted (edited)

I have bitnami LAMPStack 7.4.6-1 running MySQL database on 3306 port on newest Ubuntu. Symfony version 5.1.0 When I run this command as root user:

root@ubuntu:/opt/lampstack-7.4.6-1/apache2/htdocs/sfcourse# php bin/console doctrine:database:create

The error is:

An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user 'db_user'@'' (using password: YES)

I don't know where db_user is comming from, .env file is defining other user.

.env file DATABASE_URL=mysql://root:000000@localhost:3306/sfcourse

doctrine.yaml file:

#    parameters:
#        env(DATABASE_URL): ''
        driver: 'pdo_mysql'
        server_version: '5.7'
        charset: utf8mb4
            charset: utf8mb4
            collate: utf8mb4_unicode_ci
        url: '%env(resolve:DATABASE_URL)%'

googled but most suggestions are to make as localhost

MySQL version is 8.0.20 after checking mysql> SHOW VARIABLES LIKE "%version%";

I can login to SQL via terminal as root, that is working

I created that strange user db_user in MySQL and in .env file and got still same error.

I can connect as db_user to MySQL. If I change user in .env to other, error still says db_user.

EDIT: this is same question https://stackoverflow.com/questions/55687722/an-exception-occurred-in-driver-sqlstatehy000-1045-access-denied-for-user, he installed what he had and that solved problem? Dumb


Edited by eXPlosion

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.