Search code examples
mysqlnode.jsormsequelize.jsread-replication

Sequelize connection for read replicas, how to connect to different ports?


I am trying to access MySQL databases from Sequelize. The MySQL setup is such that read nodes have different port compared to write. I could only find this from docs page. Sequelize read replica connection . What would a correct json connection file look like with mentioned port differences.


Solution

  • According to the docs you can have different write and read connection configuration. The doc was just a bit painful to find.