Learn Django ( 2.1) - Connecting Django 2 Application To Mysql Database #6

preview_player
Показать описание
In this django tutorial I want to show you how you can Connect your Django 2 Application To Mysql Database, for the Mysql Database purpose we are using wamp server and also before Connecting Django 2 Application With Mysql Database you need to install mysqlclient

This the first way for installing mysqlclient if you get error than try
the second and third one

pip install mysqlclient

Second Way
pip install --only-binary :all: mysqlclient

Third way download the wheel file

You can check our website

Learn Django 2.1 - Introduction, Installation And Creating First Project #1

Learn Django 2 .1 - How To Create Super User (Admin Panel) #2

Learn Django (2.1) - What Are Django Apps #3

Learn Django (2. 1) - URL Configuration In Django Part One #4

Рекомендации по теме
Комментарии
Автор

Many thanks.


I got the solution before the end of your pedagogic tutorial.

ayodele_great
Автор

For those on OSX using MAMP server, you will need to edit your .bash_profile and add the following line:

export

before you can sudo pip3 install mysqlclient

you may also need to edit the mysql.config file

i) modify file: /usr/local/bin/mysql_config (which mysql_config)
origin:

# Create options
libs="-L$pkglibdir"
libs="$libs -l "
modified to

# Create options
libs="-L$pkglibdir"
libs="$libs -lmysqlclient -lssl -lcrypto"
ii)add environment veriables(brew info openssl)

export
export
iii)pip3 install mysqlclient

PedramBadakhchani
Автор

im getting an error code : 'C:\\Program Files (x86)\\Microsoft Visual exit code 2

christianbegg
Автор

please help me...
i want connect mysql to my django prject in "CPanel"

zutiqueshop
Автор

after following the video, they said me when i run migrations 'No migrations to apply'
So any tables have been created in my sql database. Please, i need help.

jauresmian
Автор

oh Mr.Parwez its tooo difficult to install mysqlconnector, some file miss in visual studio and all stuff, i spend two days behind it, now using sqlite

anoopkg
Автор

@Parwiz Forogh i am using 3.7 version of python.. and all three methods are not working .

1.method i-e pip install mysqlclient ..returns a error that
MySQLdb/_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual
86\\cl.exe' failed with exit status 2
2nd and 3rd method is also not working

behrozgujjar
Автор

Hi! I am tried to install by three ways, and its was installed without error. After, when i tried to migrate django i have error like Error loading MySQLdb module.
Did you install mysqlclient?'
But packages were installed!

I am used Anaconda, latest version. Windows 8.1

bralbral
Автор

Hello, how i install mysqlclient for mac, python3?

teoboufis
Автор

error: 'cl.exe' command failed: no file or directory.this occurs when I run the command: pip install mysqlclient on windows cmd, can you help me.

PauloRoberto-yjkw