dpblwmh5218 2019-07-30 20:58
浏览 141

SQLSTATE [HY000] [1045]拒绝访问用户'mamim'@'localhost'(使用密码:YES)

I am new to Laravel framework. I keep getting this error when trying to write php artisan serve in terminal. I am not able to do somethings .Below is the info I have in my .env file.

'mysql' => [
            'driver' => 'mysql',
            'host' => env('DB_HOST', 'localhostphp artisan make:migration create_users_table
'),
            'port' => env('DB_PORT', '3306'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'charset' => 'utf8',
            'collation' => 'utf8_unicode_ci',
            'prefix' => '',
            'strict' => false,
            'engine' => null,
        ],

and my .env file

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=mamim
DB_USERNAME=mamim
DB_PASSWORD=password

I tried to clear cahce but I met always the same error; SQLSTATE[HY000] [1045] Access denied for user 'mamim'@'localhost' (using password: YES)

  • 写回答

1条回答 默认 最新

  • dsxay48646 2019-07-30 21:34
    关注

    Change 'host' => env('DB_HOST', 'localhostphp artisan make:migration create_users_table'), to 'host' => env('DB_HOST', 'localhost'), then try it.

    Can you log into the mysql database with those credentials on the command line or in a MySQL GUI (like phpmyadmin, SequelPro, etc)?

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度