PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, March 14, 2022

[FIXED] Access denied for 'root@localhost' (using password: NO)

 March 14, 2022     laravel, macos, mamp, mysql, php     No comments   

Issue

I recently installed mac OSX. I installed latest version of mamp.

I was trying to setup my database, but i got this error.

Access denied for 'root@localhost' (using password: NO)

my .env file --

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=some
DB_USERNAME=root
DB_PASSWORD=

My MySQL port is 3306, Apache port is 80 (I changed it).

I don't change the password of PhpMyAdmin. But I get an error like this.

So I tried entering some password, then it is giving me same error with password using: YES

How can I fix it?


Solution

If you are using MAMP try this.

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=some
DB_USERNAME=root
DB_PASSWORD=root

Open your MAMP There your will see 3 options 1. Preferences 2. Open WebStart Page 3. Start / Stop Servers

Click second one [ Open WebStart Page]. It will open mamp info page. Under MySQL area you can see your database connection details.

MAMP Start

See your connection details

Hope it will help you.



Answered By - Muthu17
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing