Connect to production database on vps from local dev environment
I am using a Ubuntu 20.04.1 LTS
VPS with a deployed Laravel Framework 6.20.16
application.
I am currently connecting to my mysql database via ssh using dbeaver, using simply root@IP_Address
and my password
to connect.
However, I would also like to connect via laravel to my staging/production database as it is not an option to mirror the production database locally.
I am aware that if implemented wrongly it could cause serious vulnerabilities to my application.
Any suggestions how to do this?
I would really appreciate your help!
Do not connect a development environment to a production database. Too much risk of untested code causing problems. And too often test environments allow poor security practices. Ideally, developers do not have direct access to production, no ssh and no DB credentials.
Create empty testing databases. Import enough example data to do testing.
Two production ready code releases could be a different situation. An incremental rollout allows a subset of users to experience a change first.