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
Asked
Active
Viewed 208 times
1 Answers
0
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.

Darsh Modi
- 289
- 1
- 9
-
They would not let met have root access so I cannot install mysqlclient – Omar Redwan Dec 19 '20 at 14:04
-
No, there is no need to access the root to install the mysqlclient you only need to do is that just run **pip install mysqlclient** in your terminal from any code editor you use, I personally prefer **pycharm** for django projects. – Darsh Modi Jan 20 '21 at 10:38