Magento – Install Magento2 using different MySQL port

installationmagento2magento2-dev-betaMySQL

I have MySQL server running on a different port than the default one.

Suppose, the default port for MySQL is 3306. I have another MySQL server running on port 5625. I want to install Magento2 using MySQL database from port 5625.

While installing Magento2, I can only specify hostname, username, password and database name.

How can I specify port number as well at the time of installation?

Best Answer

If you use the CLI, you can append the port to the --db-host flag. You can probably do the same thing in the Setup Wizard.

IOW, --db-host=localhost:5625