January 8, 2021 ← Last time: Generate Day 2 project
This article is not a single article. I wrote it as a diary, so I think it will be useful for those who are new to it. If you want to learn Django, we recommend reading it from [Day 1] Django Development Environment.
This time I prepared the database. In conclusion, nothing went on ... But what did you get? !!
I could have done it with SQLite, which is included in Django by default, but since the site I was referring to explained MariaDB and PostgreSQL, I tried that setting.
First, I tried Postgresql.
$ su postgres
#password input
It seems that this can be done, but I gave up because I did not know the password of postgresql, the password change, and the command su did not understand well.
MariaDB seems to be compatible with MySQL, and I used to use MySQL at university, so I felt like I could do it. I didn't have mySQL in the terminal at first, so I started by installing mysql with homebrew. (Code omitted)
So, it seems that you can do it by entering the following code. Enter the root password in {password}.
$ mysql -u root -p{password}
I did it with this,
mysql: [Warning] Using a password on the command line interface can be insecure.
I got an error like that. I think that the root setting is correct because it is set from the directory utility in System Preferences.
After that, as a result of various investigations, it was said that if the password was read from an external file with the vi command, it would not come out, so I tried it, but I could not.
The study time this time was only 2 hours, so I couldn't make it. Looking back at the diary, is there a place where Postgresql can do a little more? I think. If that doesn't work, try SQLite.
← Last time: Generate Day 2 project → Next time: Generate Day 4 application
Recommended Posts