0

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 1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

They would not let met have root access so I cannot install mysqlclient
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.