Omar Redwan
Omar Redwan

Reputation: 145

How to use mysql-connector mysql adapter with django??/

I cannot use mysqlclient package in the hosting server because it is a shared hosting server and they would not let me have a root privilige!! so I found about the mysql-connector adapter, I guess it is developed by MySQL but I could not find anyone using it to connect to the database, does someone know how to use it?? please help

Upvotes: 0

Views: 249

Answers (1)

Darsh Modi
Darsh Modi

Reputation: 298

  • First of all you have to run the command pip install mysqlclient after that change your settings.py file with this code.

    DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'DB_NAME', 'USER': 'root', 'PASSWORD': 'root', 'HOST': 'Your host', 'PORT': 3306 } }

  • I think it should work for you. But would like to inform you that some of the hosting servers mostly support the Postgresql rather than the MySQL DB.

Upvotes: 0

Related Questions