SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO)

后端 未结 3 900
终归单人心
终归单人心 2020-12-18 16:59

I´m working with symfony 2.1.2, FOSuserBundle, SonataAdminBundle, SonataUserBundle and SonataMediaBundle. The problem is that I cannot access to my database and get this err

3条回答
  •  攒了一身酷
    2020-12-18 17:32

    the problem is within your config.yml, the

    dbal:
      types:
        json: Sonata\Doctrine\Types\JsonType
    

    should go inside doctrine dbal. Like this:

    doctrine:
        dbal:
            default_connection:   default
            connections:
                default:
                    driver:   %database_driver%
                    host:     %database_host%
                    port:     %database_port%
                    dbname:   %database_name%
                    user:     %database_user%
                    password: %database_password%
                    charset:  UTF8
            types:
                json: Sonata\Doctrine\Types\JsonType
    

    Hope it helps

提交回复
热议问题