<p>This is all very specific to the box you're using, and how it's configured. I realize Scotch Box is a historically popular setup; you might also consider <a href="https://laravel.com/docs/5.5/homestead" rel="nofollow noreferrer">Homestead</a> as it is geared specifically for PHP development.</p>

<p>Anyway, according to the <a href="https://box.scotch.io/docs/" rel="nofollow noreferrer">Scotch Box docs</a> the setup should be:</p>

<p>Database Host: localhost
Database User: root
Database Password: root</p>

<p>Which I assume you're doing in the second example? You are also running all of this from <em>inside</em> of the box, yes?</p>

CC BY-SA 3.0
2018-01-10T13:13:27.930Z
2018-01-10T13:13:27.930Z
andrew.welch
<p>Fully detailed video on how to install Craft with Scotchbox is here:</p>

<p><a href="https://craftquest.io/courses/localhosting-craft-cms/4312" rel="nofollow noreferrer">https://craftquest.io/courses/localhosting-craft-cms/4312</a></p>

<p>Missing step is SSHing into vagrant box</p>

CC BY-SA 4.0
2019-12-02T03:33:29.020Z
2019-12-02T03:33:29.020Z
Gareth L
<p>The default database name created by Scotchbox is <code>scotchbox</code>, not Craft, and the DB Password is <code>root</code>.</p>

<p>You can find the DB connection details in <a href="https://box.scotch.io/docs/" rel="nofollow noreferrer">the Scotchbox Docs</a>.</p>

CC BY-SA 3.0
2018-01-10T15:45:07.007Z
The database name should be the name of the database. If he chose the name `craft` it is craft. If he created a database with the name `foo` it will be that. The same goes for the password as well. You can set/change it. These values are not "hard-coded"
Robin Schambach
CC BY-SA 3.0
2018-01-10T16:04:34.657Z
@RobinSchambach If the OP provisioned a Scotchbox, which he _clearly says he did_, then the database is created with the name Scotchbox with username password root:root by default, as stated in the Scotchbox docs… https://box.scotch.io/docs/
Seth Warburton
CC BY-SA 3.0
2018-01-10T16:06:49.313Z
But he could have created a new one. You could have asked him if that's the case or if he didn't -so you could hint about the docs and the default values but it sounded like it's impossible to create a db called `craft`
Robin Schambach
CC BY-SA 3.0
2018-01-10T16:07:04.067Z
Thanks for the downvote though @RobinSchambach.
Seth Warburton
CC BY-SA 3.0
2018-01-10T16:09:25.040Z
He doesn't say he created a new DB, he does say he used Scotchbox, so I told him the connection parameters he needs to connect to _a Scotchbox provisioned database_ which is what he asked. Sigh.
Seth Warburton
CC BY-SA 3.0
2018-01-10T16:11:50.967Z
"I can connect fine with Sequel Pro using the same credentials." I expect he is aware of the database name if he was in the interface and checked the credentials
Robin Schambach
CC BY-SA 3.0
2018-01-10T21:11:18.207Z
Sorry folks - to clarify, I did intentionally change the db name and password from the defaults that came with Scotchbox, and have successfully connected with those new details using SP.
Adam George
CC BY-SA 3.0
2018-01-10T14:40:56.017Z
2018-01-10T16:23:34.627Z
2018-01-10T16:23:34.627Z
Seth Warburton
<p>I am using <a href="https://box.scotch.io/" rel="nofollow noreferrer">https://box.scotch.io/</a> (vagrant).</p>

<p>I'm trying to install Craft 3 with the cli, but can't get past these errors:</p>

<ul>
<li>Connection refused </li>
<li>No such file or directory</li>
</ul>

<p>One or the other error shows up depending on what I use for the host name.</p>

<ul>
<li>I have tried the answer <a href="https://craftcms.stackexchange.com/questions/23056/craft-cli-rc1-connectivity-issues-with-mamp-pro">here.</a></li>
<li>I can connect fine with Sequel Pro using the same credentials.</li>
</ul>

<p>(Note: I did intentionally change the db name and password from the defaults that came with Scotchbox, and have successfully connected with those new details using Sequel Pro).</p>

<p>See log:</p>

<pre><code>Which database driver are you using? [mysql,pgsql,?]: mysql
Database server name or IP address: [192.168.33.10] 
Database port: [3306] 
Database username: [root] 
Database password: 
Database name: [craft] 
Database table prefix: 
Testing database credentials... failed: SQLSTATE[HY000] [2002] Connection refused
Which database driver are you using? [mysql,pgsql,?]: mysql
Database server name or IP address: [192.168.33.10] localhost
Database port: [3306] 
Database username: [root] 
Database password: 
Database name: [craft] 
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] 
Database table prefix: 
Testing database credentials... failed: SQLSTATE[HY000] [2002] Connection refused
</code></pre>

<install><mysql><composer><cli>
How do I get past this MySQL error installing Craft 3 using CLI
# How do I get past this MySQL error installing Craft 3 using CLI

(Asked by: username_0 on 2018-01-10)

I am using https://box.scotch.io/ (vagrant).
I'm trying to install Craft 3 with the cli, but can't get past these errors:

Connection refused 
No such file or directory

One or the other error shows up depending on what I use for the host name.

I have tried the answer here.
I can connect fine with Sequel Pro using the same credentials.

(Note: I did intentionally change the db name and password from the defaults that came with Scotchbox, and have successfully connected with those new details using Sequel Pro).
See log:
Which database driver are you using? [mysql,pgsql,?]: mysql
Database server name or IP address: [192.168.33.10] 
Database port: [3306] 
Database username: [root] 
Database password: 
Database name: [craft] 
Database table prefix: 
Testing database credentials... failed: SQLSTATE[HY000] [2002] Connection refused
Which database driver are you using? [mysql,pgsql,?]: mysql
Database server name or IP address: [192.168.33.10] localhost
Database port: [3306] 
Database username: [root] 
Database password: 
Database name: [craft] 
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] 
Database table prefix: 
Testing database credentials... failed: SQLSTATE[HY000] [2002] Connection refused

**Tags:** install, mysql, composer, cli


---

## 3 answers

### Answer by username_1 on 2018-01-10. Score: 1 | Accepted answer

This is all very specific to the box you're using, and how it's configured. I realize Scotch Box is a historically popular setup; you might also consider [Homestead](https://laravel.com/docs/5.5/homestead) as it is geared specifically for PHP development.

Anyway, according to the [Scotch Box docs](https://box.scotch.io/docs/) the setup should be:

Database Host: localhost
Database User: root
Database Password: root

Which I assume you're doing in the second example? You are also running all of this from *inside* of the box, yes?


---

### Answer by username_2 on 2019-12-02. Score: 1

Fully detailed video on how to install Craft with Scotchbox is here:

<https://craftquest.io/courses/localhosting-craft-cms/4312>

Missing step is SSHing into vagrant box


---

### Answer by username_3 on 2018-01-10. Score: 1

The default database name created by Scotchbox is `scotchbox`, not Craft, and the DB Password is `root`.

You can find the DB connection details in [the Scotchbox Docs](https://box.scotch.io/docs/).

> **Comments:**
> **username_4**: The database name should be the name of the database. If he chose the name `craft` it is craft. If he created a database with the name `foo` it will be that. The same goes for the password as well. You can set/change it. These values are not "hard-coded"  
> **username_3**: @RobinSchambach If the OP provisioned a Scotchbox, which he _clearly says he did_, then the database is created with the name Scotchbox with username password root:root by default, as stated in the Scotchbox docs… https://box.scotch.io/docs/  
> **username_4**: But he could have created a new one. You could have asked him if that's the case or if he didn't -so you could hint about the docs and the default values but it sounded like it's impossible to create a db called `craft`  
> **username_3**: Thanks for the downvote though @RobinSchambach.  
> **username_3**: He doesn't say he created a new DB, he does say he used Scotchbox, so I told him the connection parameters he needs to connect to _a Scotchbox provisioned database_ which is what he asked. Sigh.  
> **username_4**: "I can connect fine with Sequel Pro using the same credentials." I expect he is aware of the database name if he was in the interface and checked the credentials  
> **username_0**: Sorry folks - to clarify, I did intentionally change the db name and password from the defaults that came with Scotchbox, and have successfully connected with those new details using SP.  

---

