8

I have my nginx running on port 8080 and mysql running on port 3307. I want to install magento 2 cloned from git using CLI. Any idea how to configure the database which will use the port number 3307.

Can I just put --db-host = "localhost:3307"? Will this work for me?

asked Jul 19, 2017 at 4:28

2 Answers 2

11

http://devdocs.magento.com/guides/v2.2/install-gde/install/cli/install-cli-install.html

--db-host=localhost:3307

Note: You can optionally specify the database server port in its host name like www.example.com:9000

in your case: localhost:3307

answered Jul 29, 2017 at 17:42
0
3

Incase you already installed via CLI, but you can change later on env.php

 'connection' => [
 'default' => [
 'host' => '127.0.0.1',
 'dbname' => '****',
 'username' => 'root',
 'password' => '*****',
 'model' => 'mysql4',
 'engine' => 'innodb',
 'initStatements' => 'SET NAMES utf8;',
 'active' => '1'
 ]
 ]

to

'connection' => [
 'default' => [
 'host' => '127.0.0.1:3307',
 'dbname' => '****',
 'username' => 'root',
 'password' => '*****',
 'model' => 'mysql4',
 'engine' => 'innodb',
 'initStatements' => 'SET NAMES utf8;',
 'active' => '1'
 ]
]

Just add port number in 'host'

answered Jan 27, 2021 at 17:34

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.