有了这个laravel sql特权,任何好的解决方案?

时间:2017-12-22 14:56:24

标签: php mysql laravel

我在laravel尝试访问mysql时遇到错误,就像这样说

   ` enter code here
SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' (SQL: sele  
          ct * from information_schema.tables where table_schema = blog and table_nam  
          e = migrations) 
In Connector.php line 67:

          SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' `enter code here`
`

1 个答案:

答案 0 :(得分:1)

这不是与laravel本身有关的问题。检查与数据库相关的.env设置。通常有类似的内容:

DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=default
DB_USERNAME=root
DB_PASSWORD=secret