Jump to content

Recommended Posts

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'@'127.0.0.1' (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:

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

googled but most suggestions are to make 127.0.0.1 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
Link to comment
https://forums.phpfreaks.com/topic/310932-doctrinedatabasecreate/
Share on other sites

  • 1 month later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
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.

×
×
  • 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.