Closed lookdeceline closed 4 years ago
Successfully migrated to MySQL. Here is tutorial:
Install MySql by
brew install mysql
Install mysqlclient by
pip install mysqlclient
Start mysql service by
brew services start mysql
(to stop homebrew mysql service, you can brew services stop mysql
)
Login to mysql by
mysql -u root
Create Database in mysql by
CREATE DATABASE pillbox;
CREATE USER jay IDENTIFIED BY 'pillbox1!';
<- should exactly be jay / pillbox1!
GRANT ALL PRIVILEGES ON pillbox.* TO jay;
FLUSH PRIVILEGES
exit
Now our mysql is all set. Now, we should migrate Django DB to MySQL.
Type python manage.py makemigrations appname
for each app <- This should be done before any migrations!!!
Type python manage.py migrate
Type python manage.py runserver
to check if it runs well.
brew install mysql
대신 sudo apt-get install mysql-server
등등으로 대체하면 됨 ^^Need to consistantly refer
Linux needs to do additional sudo apt-get install libmysqlclient-dev
between 1 and 2
For linux, No.3 is sudo systemctl start mysql
In case of encoding error
use {databaseName}
alter table {table name} convert to character set utf8mb4;
sql lite ==> my sql
don't forget about it!