-
DB 연결Back end/django 2023. 9. 13. 10:09
* Maria db
Enter password: ****
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 5
Server version: 11.1.2-MariaDB mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> creat database kicdb
-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'creat database kicdb' at line 1
MariaDB [(none)]> create database kicdb
-> ;
Query OK, 1 row affected (0.004 sec)
MariaDB [(none)]> create user 'kic'@localhost identified by '1111'
-> ;
Query OK, 0 rows affected (0.011 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'kic'@localhost IDENTIFIED BY '1111';
Query OK, 0 rows affected (0.003 sec)
MariaDB [(none)]> use kicdb;
Database changed
MariaDB [kicdb]> show tables
-> ;
+----------------------------+
| Tables_in_kicdb |
+----------------------------+
| auth_group |
| auth_group_permissions |
| auth_permission |
| auth_user |
| auth_user_groups |
| auth_user_user_permissions |
| board_board |
| django_admin_log |
| django_content_type |
| django_migrations |
| django_session |
| member_member |
+----------------------------+
12 rows in set (0.001 sec)* anaconda (migration 해줘야함!)
(base) C:\Users\wlstn\python2308\django\kicwebpro>python manage.py makemigrations board
No changes detected in app 'board'
(base) C:\Users\wlstn\python2308\django\kicwebpro>python manage.py makemigrations board
Migrations for 'board':
board\migrations\0001_initial.py
- Create model Board
(base) C:\Users\wlstn\python2308\django\kicwebpro>python manage.py makemigrations member
Migrations for 'member':
member\migrations\0001_initial.py
- Create model Member
(base) C:\Users\wlstn\python2308\django\kicwebpro>python manage.py makemigrate
Unknown command: 'makemigrate'. Did you mean makemigrations?
Type 'manage.py help' for usage.
(base) C:\Users\wlstn\python2308\django\kicwebpro>python manage.py migrate
Operations to perform:
Apply all migrations: admin, auth, board, contenttypes, member, sessions
Running migrations:
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying admin.0001_initial... OK
Applying admin.0002_logentry_remove_auto_add... OK
Applying admin.0003_logentry_add_action_flag_choices... OK
Applying contenttypes.0002_remove_content_type_name... OK
Applying auth.0002_alter_permission_name_max_length... OK
Applying auth.0003_alter_user_email_max_length... OK
Applying auth.0004_alter_user_username_opts... OK
Applying auth.0005_alter_user_last_login_null... OK
Applying auth.0006_require_contenttypes_0002... OK
Applying auth.0007_alter_validators_add_error_messages... OK
Applying auth.0008_alter_user_username_max_length... OK
Applying auth.0009_alter_user_last_name_max_length... OK
Applying auth.0010_alter_group_name_max_length... OK
Applying auth.0011_update_proxy_permissions... OK
Applying auth.0012_alter_user_first_name_max_length... OK
Applying board.0001_initial... OK
Applying member.0001_initial... OK
Applying sessions.0001_initial... OK'Back end > django' 카테고리의 다른 글
django 흐름 (0) 2023.09.11 django (업뎃예정) (0) 2023.09.08