Answers.Body: <p>I was just confronted with this too. You most likely need to specify the unixSocket attribute for the MAMP Pro database. Take a look at my problem and solution at <a href="https://craftcms.stackexchange.com/questions/23056/craft-cli-rc1-connectivity-issues-with-mamp-pro">Craft CLI RC1 Connectivity Issues with MAMP Pro</a>. Though if you're not able to get it working at all even manually I would definitely suggest resetting your root password in MAMP Pro as well.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-09T05:54:44.547Z
Answers.LastActivityDate: 2017-12-09T05:54:44.547Z
Answers.UserDisplayName: Tim Knight
Answers.Body: <p>Nothing worked mentioned here. </p>
  
  <p>But after these steps</p>
  
  <ol>
  <li>Enable "Allow network access to MySQL" -> "only from this Mac"</li>
  <li>Save</li>
  <li>Restart</li>
  </ol>
  
  <p>It worked!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-18T10:28:34.110Z
Answers.LastActivityDate: 2019-04-18T10:28:34.110Z
Answers.UserDisplayName: Trajektorijus
Answers.Body: <p>This note is a "thank you" to the commentators above. After a few hours of "slugging" (starting with the effort to download composer), here is what worked for me:</p>
  
  <pre><code>Which database driver ... : mysql
  Database server name or IP ... : 127.0.0.1
  Database port: [3306] 8889 (note: via MAMP)
  Database username: [root] root
  Database password:
  Database name: EnergyAudit
  Database table prefix (type "none" for none): Probs
  Testing database credentials ... success!
  Saving database credentials to your .env file ... done
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-14T13:37:10.080Z
Answers.LastActivityDate: 2018-11-14T23:29:18.023Z
Answers.LastEditDate: 2018-11-14T23:29:18.023Z
Answers.UserDisplayName: user3315638
Answers.Body: <p>Had very similar issues but no MAMP or WAMP; just vanilla Apache and MySQL 5.7.23 (Had the same error with 8.0.12 too - did not test the solution).</p>
  
  <p>It worked for me to type in 127.0.0.1 instead of <em>blank</em> or <em>localhost</em> in the terminal window when going through the Craft3 setup steps.</p>
  
  <pre><code>Which database driver are you using? [mysql,pgsql,?]: mysql
  Database server name or IP address: [localhost] 127.0.0.1
  Database port: [3306] 
  Database username: [root] 
  Database password: 
  Database name: craft_test_h828
  Database table prefix: 
  Testing database credentials... success!
  Saving database credentials to your .env file... done
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-28T17:15:53.917Z
Answers.LastActivityDate: 2018-08-28T18:02:52.520Z
Answers.LastEditDate: 2018-08-28T18:02:52.520Z
Answers.UserDisplayName: Herra Jon
Body: <p>I've installed Craft 3 through composer and I'm attempting to work through the setup process within terminal:</p>
  
  <pre><code>MacBook-Pro:~ jamie$ ~/Documents/repos/__craft-3-beta/craft setup
  Which database driver are you using? [mysql,pgsql,?]: mysql
  Database server name or IP address: [localhost] 
  Database port: [3306] 
  Database username: [root] 
  Database password: 
  Database name: craft-three
  Database table prefix: 
  Testing database credentials... failed: SQLSTATE[HY000] [2002] No such file or directory
  Which database driver are you using? [mysql,pgsql,?]: mysql
  Database server name or IP address: [localhost] 127.0.0.1
  Database port: [3306] 
  Database username: [root] 
  Database password: 
  Database name: [craft-three] 
  Database table prefix: 
  Testing database credentials... failed: SQLSTATE[HY000] [2002] Connection refused
  </code></pre>
  
  <p>Notice that I get 2 different errors when using the IP add and localhost for DB_SERVER</p>
  
  <p>I also cant get it working when manually filling in the .env file.</p>
  
  <p>I'm using MAMP Pro on a Mac. </p>
  
  <p>Any help on this will be greatly appreciated.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-08T13:39:40.190Z
Comments.Text: did you use root for your db password? I had issues here as had changed it in the past, so used a new user/pw
Comments.UserDisplayName: user2569
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-08T15:32:01.400Z
Comments.Text: I've tried 'root' and leaving it blank. Both result in the same errors. 
  
  I dont really want to change my root password, as i'll have to change all instances of the password within phpMyAdmin, and other scripts which are used with MAMP
Comments.UserDisplayName: Spacecentre
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-08T17:45:48.553Z
Comments.Text: Don't have MAMP install locally, but doesn't it use a different database port by default?
Comments.UserDisplayName: Brad Bell
Tags: <craft3><installation><composer>
Title: Craft 3 Command setup failing
ThreadText: # Craft 3 Command setup failing
  
  (Asked by: username_0 on 2017-12-08)
  
  I've installed Craft 3 through composer and I'm attempting to work through the setup process within terminal:
  
  ```
  MacBook-Pro:~ jamie$ ~/Documents/repos/__craft-3-beta/craft setup
  Which database driver are you using? [mysql,pgsql,?]: mysql
  Database server name or IP address: [localhost] 
  Database port: [3306] 
  Database username: [root] 
  Database password: 
  Database name: craft-three
  Database table prefix: 
  Testing database credentials... failed: SQLSTATE[HY000] [2002] No such file or directory
  Which database driver are you using? [mysql,pgsql,?]: mysql
  Database server name or IP address: [localhost] 127.0.0.1
  Database port: [3306] 
  Database username: [root] 
  Database password: 
  Database name: [craft-three] 
  Database table prefix: 
  Testing database credentials... failed: SQLSTATE[HY000] [2002] Connection refused
  
  ```
  
  Notice that I get 2 different errors when using the IP add and localhost for DB\_SERVER
  
  I also cant get it working when manually filling in the .env file.
  
  I'm using MAMP Pro on a Mac.
  
  Any help on this will be greatly appreciated.
  
  **Tags:** craft3, installation, composer
  
  > **Comments:**
  > **username_1**: did you use root for your db password? I had issues here as had changed it in the past, so used a new user/pw  
  > **username_0**: I've tried 'root' and leaving it blank. Both result in the same errors.   I dont really want to change my root password, as i'll have to change all instances of the password within phpMyAdmin, and other scripts which are used with MAMP  
  > **username_2**: Don't have MAMP install locally, but doesn't it use a different database port by default?  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_3 on 2017-12-09. Score: 5
  
  I was just confronted with this too. You most likely need to specify the unixSocket attribute for the MAMP Pro database. Take a look at my problem and solution at [Craft CLI RC1 Connectivity Issues with MAMP Pro](https://craftcms.stackexchange.com/questions/23056/craft-cli-rc1-connectivity-issues-with-mamp-pro). Though if you're not able to get it working at all even manually I would definitely suggest resetting your root password in MAMP Pro as well.
  
  
  ---
  
  ### Answer by username_4 on 2019-04-18. Score: 4
  
  Nothing worked mentioned here.
  
  But after these steps
  
  1. Enable "Allow network access to MySQL" -> "only from this Mac"
  2. Save
  3. Restart
  
  It worked!
  
  
  ---
  
  ### Answer by username_5 on 2018-11-14. Score: 1
  
  This note is a "thank you" to the commentators above. After a few hours of "slugging" (starting with the effort to download composer), here is what worked for me:
  
  ```
  Which database driver ... : mysql
  Database server name or IP ... : 127.0.0.1
  Database port: [3306] 8889 (note: via MAMP)
  Database username: [root] root
  Database password:
  Database name: EnergyAudit
  Database table prefix (type "none" for none): Probs
  Testing database credentials ... success!
  Saving database credentials to your .env file ... done
  
  ```
  
  
  ---
  
  ### Answer by username_6 on 2018-08-28. Score: 1
  
  Had very similar issues but no MAMP or WAMP; just vanilla Apache and MySQL 5.7.23 (Had the same error with 8.0.12 too - did not test the solution).
  
  It worked for me to type in 127.0.0.1 instead of *blank* or *localhost* in the terminal window when going through the Craft3 setup steps.
  
  ```
  Which database driver are you using? [mysql,pgsql,?]: mysql
  Database server name or IP address: [localhost] 127.0.0.1
  Database port: [3306] 
  Database username: [root] 
  Database password: 
  Database name: craft_test_h828
  Database table prefix: 
  Testing database credentials... success!
  Saving database credentials to your .env file... done
  
  ```
  
  
  ---
  
  