dongye1912 2014-01-12 15:02
浏览 43

如何使用Doctrine在基于Symfony2的网站上创建数据库?

This seems like it should be pretty easy but I am running into problems trying to create a database following these instructions: http://symfony.com/doc/master/book/doctrine.html

I edit the parameters.yml and config.yml file and then run this command from terminal:

php app/console doctrine:database:create

The error I am getting is:

Could not create database for connection named `learn_symfony`
SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES)

How do I resolve this error and create the database?

  • 写回答

1条回答 默认 最新

  • dpwqicw157673 2014-01-12 15:06
    关注

    The problem is that you are probably trying to connect on a server that isn't configured properly.

    There is nothing to do with doctrine.

    Tell me, are you trying to connect to a home-made server ? Is it a LAMP or WAMP stack ?

    EDIT

    If you are running on a recently installed server, you have to edit the MySQL configuration and set a password to the root account or set on the directive allowNullPassword

    EDIT 2

    If your server is LAMP, the file you have to change is located at /etc/my.cnf

    EDIT 3 That file is for various mysql configurations. About the allow null i was mistaking with phpMyAdmin. Try setting a password for the root with this command
    mysqladmin -u root password MYVERYNEWANDSECRETPASSWORD

    评论

报告相同问题?

悬赏问题

  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算