Docker on AWS target doesn't seem to connect with MySQL

In the local development target I have docker and MySQL working well. When I switch to the remote environment target with docker on AWS, the connection test works fine but docker doesn’t seem to be connected to MySQL. For instance, the login (that checks for the user’s role in the database) doesn’t work, neither the registration form that posts to the database. The project settings are shown below:

Do I need to do some additional configuration on the database of the target? or is it something else?

Thanks in advance for your help.

Best.

Jay

I take it these are two separate DBs. One for dev and one for prod? Have you applied the DB changes from the dev DB manager to production? They don’t apply automatically.

Go into Database Manager > Changes and Apply This Change

Also,
have you got user data in you prod DB to log in with? It will be created as empty for that target.

Just a simple question. Does Wappler uploads everything that is in the local Docker container (development target) to the docker container in amazonaws (production target)? Including the MySQL database?

I followed the documentation here:

The documentation doesn’t say anything about what to do in the “Project Settings” with the Database in the amazonaws target, so I left if with the default as shown in the image above. But this seems to be the piece not working, the web app doesn’t seem to be able to connect with the database.

Anybody working with docker and MySQL in AWS?

Best.

Jay

You can synchronize your database structure between targets by pushing the schema changes.

The database data is however always separated and will never be copied.

@mgaussie please restrict your bug reports/issues to the corresponding topics

I have used AWS, Docker and MySQL loads of times and it always seems to do all the setup for me. Unless something has changed it should still be as simple as setting the DB settings in Project Manager and deploying.

If you want to connect to a DB outside the Docker image, there’s 2 DB setup places.

Database Manager:
image
This is used for retrieving schema in Server Connect when creating/editing queries etc.
Click on the connection and you will have the option of setting up a Direct Database Connection. I had to set this separately recently on a dev target which was local to connect via SSH to an AWS DB whereas the deployed one, which was within AWS too, could connect directly to the DB
image

Server Connect
The connection that the Server Connect scripts use once deployed is set up under Server Connect Globals:
image

1 Like

Thank you bpj, you are very helpful. I am new to Wappler and I am doing all the rookie mistakes.

The problem seems to stem from the fact that the tables in the db database I have created in the development target are different from the tables in the db of the aws target- which are the car examples that come with MySQL. I have two different db databases, one in the development target and another in the aws target.

How do I synchroniset the db in the development target (which is the correct one) with the db in the aws target? so that the db in both targets is the same?

Once I solve this problem I think that I will be able to tackle the Docker issue.

Best.

Jay

1 Like

@George, I try to synchronise the targets by pushing the database changes in the development target, but I still get a different database in the aws target.