1045: Access Denied for User 'root'@'localhost' (Using Password: YES)

This error means that MySQL is rejecting the username and password you're supplying. Here are a few things to check:

  1. Correct Username and Password:
    By default, MAMP uses the username 'root' and the password 'root'. Ensure your PHP scripts are using these credentials.

  2. CMS Configuration:
    If you're using a CMS (e.g., WordPress, Joomla), verify that the database access credentials in your CMS’s configuration file match what you’re currently using. If you've recently transferred your site to a new machine, the username or password for the MySQL database might have changed. Check the config file in your CMS to ensure the credentials are correct.

By ensuring your credentials are accurate, you should be able to resolve this error.