Coda has now been discontinued, in favor of their new native Mac Code editor: nova.
As such this article has now been archived.
Coda 2 has a built-in MySQL editor that allows you to connect to a remote database and editor data, define structure, and more. I’ll use Coda 2 to connect to SiteGround MySQL in this tutorial.
SiteGround is a great host for developers with Git Integration, WordPress CLI, among many other features. It is for this reason I decided to use SiteGround for this tutorial, but the process is very similar for any other host using cPanel.
I first wrote this tutorial back in 2014, and while Coda 2 has a strong following, there are now many other code editors available that now offer MySQL functionality, whether natively or via an extension. Coding editors are very much a personal choice, and while Coda works extremely well, it is no longer the most popular solution.
How to set up Coda 2 with MySQL
- You will need to log in to your SiteGround account to access all the settings.
- Under “Account DNS” copy the IP address that’s after ns2.sitegroundXXX.com
- Click the red button titled “Go to cPanel.”
This will automatically log you in to the correct cPanel account.
- Under the “Databases” section select “Remote MySQL.”
- In the “Host” field, paste the IP address from Step 3, and click “Add Host.”
- Add new site, or choose which the site you want to access the MySQL.
- Set “Database Type: MySQL Server.”
- Server: Paste the IP address used in Steps 3 and 6
The default MySQL server port is 3306. If you wish to connect to a PostgreSQL database, the default port would be 5432.
- User Name and Password: Enter the username and password associated with the database you want to access.
Note that you will gain access to all of the databases within your SiteGround count upon providing the information for just one of the databases.
- Initial Database: This should contain the name of the initial database you want to access.
- You should ensure the name matches precisely. Make sure the username and password above are already users of this database.
- Once you have connected, you will be able to add a new MySQL file and use the dropdown on the top left to select which database you wish to connect to.