7
7
7a-6662019-11-24 10:57:42
Django
7a-666, 2019-11-24 10:57:42

How to connect mysql to djang?

I read the documentation of django and surfed the Internet and did not find the answer.
Now, in order, I downloaded mysql, created a database there, now I go to the settings in django

DATABASES = {
    'default': {
        'ENGINE': django.db.backends.mysql',
        'NAME': 'имя бд',
        "HOST": 'как мне посмотреть хост? ',
        'USER': 'логин',
        "PASSWORD": 'пароль',
        "PORT": 'как мне посмотреть порт?';
        
    }
}

How to set it up correctly I will be glad to articles, vidos, answers, indicating what should be learned, and in general everything that can help with the problem and pump skills in advance thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
EvgenyCherny, 2019-11-24
@EvgenyCherny

'NAME': 'Имя базы данных',
        "HOST": 'Здесь вы можете использовать ип вашей базы данных, если все стоит на одном сервере тогда можно просто localhost ',
        'USER': 'Логин',
        "PASSWORD": 'Пароль базы данных',
        "PORT": 'Порт';

You can find out the port by going to the phpMyAdmin panel by logging into the database, clicking on Variables and finding the port variable, by default 3306

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question