我在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`
`
答案 0 :(得分:1)
这不是与laravel本身有关的问题。检查与数据库相关的.env
设置。通常有类似的内容:
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=default
DB_USERNAME=root
DB_PASSWORD=secret