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
1 Answer
First of all you have to run the command
pip install mysqlclientafter 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.
2 Comments
Omar Redwan
They would not let met have root access so I cannot install mysqlclient
Darsh Modi
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.