SO: Error connecting a MySQL database in Genie.jl
Per: https://stackoverflow.com/questions/70927061/error-connecting-a-mysql-database-in-genie-jl
@logankilpatrick Let's follow up here regarding the SO issue. I mentioned there that your MySQL config is not correct - you need to pass host, username, and password and the valid name of an existing database on that server. In addition, I need info on how you're loading the app (what steps did you take to get that error).
Ah got it, so the command does not create a new database for me? I have to manually go and create one?
I am currently just following this tutorial: https://genieframework.com/docs/tutorials/Developing-MVC-Web-Apps.html#connectingtothedatabase line by line
If genie does not create the database automatically, what are the steps I need to take to do so? Can you link me to an article? I am coming from Django where the DB is created and wired up automatically. I would also propose adding a note on this in the docs so folks know what the expectation is
The MySQL database is created automatically?
- in order to connect to the MySQL server you definitely need to provide host, username and password
- once connected, your web app user (the one used for connecting) must have database creation privileges - which is usually not the case and is a bad idea (the web user is more restricted in order to avoid privilege escalation issues through vulnerabilities in the web app)
Ex: https://medium.com/@omaraamir19966/connect-django-with-mysql-database-f946d0f6f9e3 Db and user have to be created by hand then used in the Django app.
SQLite is a different thing, maybe that's what you have in mind. SQLite is a file based DB - and yes, that is created automatically, you just need to provide the path where you want it to be created/stored.
If genie does not create the database automatically, what are the steps I need to take to do so? Can you link me to an article? I am coming from Django where the DB is created and wired up automatically. I would also propose adding a note on this in the docs so folks know what the expectation is
If you are free choosing your tools for your own the easiest way is to use MySQLWorkbench. There you will find the way to create a schema aka database intuitively. Maybe Adrian could think about to create a database only in dev mode. In production mode it is very dangerous as Adrain stated.