Today we will learn how to set up the Mysql database in our shared hosting Cpanel. I am using them here Namecheap you can use any of them. There are several steps you have to follow. Read them carefully and follow them you can easily do that.
First of all, go to the terminal with your project-specific virtualenv . See how to set up virtualenv in the Django project for Cpanel hosting here and follow the Mysql database setup. Then in the next steps install this package specify here.
##)Create New Database
##)Give Database Name
Here you need to put your database name and click Create Database
##)MySQL Users Add New User
fillup the MySQL Users Add New User form and click Create User
##)Add User To Database
After that, you need to checkmark the correct username and database name you just created in the previous step and hit Add.
##)Manage User Privileges
Then checkmark ALL PRIVILEGES and click make the change.
1. Mysql database installation
pip install pymysql
2. After that we need to install mysqlclient
pip install mysqlclient
There is a valid reason that your installation will get an error. unable to execute '/usr/bin/gcc':Permission denied.Follow this to slove that. After that follow our tutorial again
**Mysql database client installation keep in mind that the latest version of mysqlclient will not work properly. After lots of investigation I
found mysqlclient==2.1.0 is working properly.So install mysqlclient==2.1.0 .
pip install mysqlclient==2.1.0
3. After that we need to configure our database setup in our setting.py file. Just copy this below code and change the database name to your created database name the database username to your previously created username and change the password to your own database password. Keep host, port and engine as it is.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'database name ',
'USER': 'database username ',
'PASSWORD': 'database password',
'HOST': 'localhost',
'PORT': '3306',
}
}
5. After completion of the previous steps your setup is complete you are good for the final steps.
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
And that's it you are ready to go with this setup. Your database connection is ready you can work with it.
Learn How to deploy django application in shared hosting
Learn How to solve: unable to execute '/usr/bin/gcc':Permission denied in Namecheap
Learn How to develop a full stack development project from planning to coding
Julie
Aug. 21, 2025, 8:35 p.m.Are you looking for a personal assistant who can handle your daily business operations and make your life easier? I can help with tasks related to admin, marketing, gathering data from multiple websites, answering emails, website management, social media, content writing, planning new projects, bookkeeping, entering data into softwares, and back-office assistance. I have an Inhouse Content writer, social media specialist, Data Entry Operator, Website Developer and Bookkeeper. My costing varies from $8/hr to $30/hr depending on type of project and its complexity. If you are interested, send me an email at Businessgrowtogether@outlook.com with a list of tasks you want to accomplish, and We can discuss our collaboration over a video call as per your convenience.
ReplyAshok
July 24, 2025, 10:37 p.m.Hi, I’m Ashok! As a Website Developer, I help businesses build and enhance their online presence with WordPress, PHP, and other CMS platforms. My services include new website design, redesigning old websites, content uploads, plugin-related work, and functionality development. Reach out at webdesignservices111@outlook.com
ReplyDavid Schipper
July 2, 2025, 5:40 p.m.Why not have a Marketer or Webmaster in the U.S.? [ NOTHING overseas ] TX based Get More Google Reviews (More Reviews = More Business) and Much More! Only $199/mo [ Hosting Included upon client request ] - 26 Years Experience Find out more, see our list of clients and read our reviews: https://adventdigital.net/seo/17-point-plan/ https://g.page/r/CUY2hdTXAq4sEBM/ (Unsubscribe on Request - Email or Text)
ReplyRahul
June 16, 2025, 1:32 a.m.Hi, I'm Rahul, a Data Entry Virtual Assistant offering accurate and efficient services for just $8/hour. I handle online data entry, e-commerce product uploads, form processing, web scraping, lead generation, Excel formatting, and more. Email me at Yourvirtualassistant23@outlook.com for your data needs!
ReplyDavid Schipper
June 2, 2025, 3:11 p.m.Why not have a Marketer or Webmaster in the U.S.? [ NOTHING overseas ] TX based Get More Google Reviews (More Reviews = More Business) and Much More! Only $199/mo [ Hosting Included upon client request ] - 26 Years Experience Find out more, see our list of clients and read our reviews: https://adventdigital.net/seo/17-point-plan/ https://g.page/r/CUY2hdTXAq4sEBM/ (Unsubscribe on Request - Email or Text)
ReplyDavid Schipper (CEO, Technician)
May 27, 2025, 2:59 p.m.Why not have a Marketer or Webmaster in the U.S.? [ NOTHING overseas ] TX based Get More Google Reviews (More Reviews = More Business) and Much More! Only $199/mo [ Hosting Included upon client request ] - 26 Years Experience Find out more, see our list of clients and read our reviews: https://adventdigital.net/seo/17-point-plan/ https://g.page/r/CUY2hdTXAq4sEBM/ (Unsubscribe on Request - Email or Text)
ReplyDavid Schipper
May 21, 2025, 3:53 p.m.Why not have a Marketer or Webmaster in the U.S.? [ NOTHING overseas ] TX based Get More Google Reviews (More Reviews = More Business) and Much More! Only $199/mo [ Hosting Included upon client request ] - 26 Years Experience Find out more, see our list of clients and read our reviews: https://adventdigital.net/seo/17-point-plan/ https://g.page/r/CUY2hdTXAq4sEBM/ (Unsubscribe on Request - Email or Text)
Reply