Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7851017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:03:53+00:00 2026-06-02T19:03:53+00:00

I am trying to connect MySQLdb to MySQL. It was working fine when when

  • 0

I am trying to connect MySQLdb to MySQL. It was working fine when when my server was localhost and port 80. But due to some reason I had to change the port to 8080. Now how do I specify the port in the connect command?
This is what I was using earlier:

db = MySQLdb.connect(host = "localhost", user = "root", passwd = "", db = "pymysql")

Now my server is “localhost:8080”. So where should I give the information regarding this port?
I tried this :

db = MySQLdb.connect(host = "127.0.0.1:8080", user = "root", passwd = "", db = "pymysql")

This is what I got :

Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
db = MySQLdb.connect(host = "127.0.0.1:8080", user = "root", passwd = "", db = "pymysql")
File "C:\Python27\lib\site-packages\MySQLdb\__init__.py", line 81, in Connect
return Connection(*args, **kwargs)
File "C:\Python27\lib\site-packages\MySQLdb\connections.py", line 187, in __init__
super(Connection, self).__init__(*args, **kwargs2)
OperationalError: (2005, "Unknown MySQL server host '127.0.0.1:8080' (11004)")

Please Help !!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T19:03:55+00:00Added an answer on June 2, 2026 at 7:03 pm

    You should read the documentation.

    connect(parameters...)
    
    
        host
            name of host to connect to. Default: use the local host via a UNIX socket (where applicable)
        user
            user to authenticate as. Default: current effective user.
        passwd
            password to authenticate with. Default: no password.
        db
            database to use. Default: no default database.
        port
            TCP port of MySQL server. Default: standard port (3306).
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to connect to a mysql db, but from another server and process
I'm trying to connect to a MySQL database on a remote server using MySQLdb
Im trying to connect mysql with android but it throw me an error. Error
i am trying to connect with sql server 2008 using java connection string but
I'm using a standard MySQL db on my server and trying to connect my
I am trying to connect to MySQL DB using php script. But I don't
I'm trying conn = MySQLdb.connect (host = localhost, user = username, passwd = password,
im trying to connect mysql in android app. Below is my code. Once i
Im trying to connect MySql from VB.NET in visual basic 2010. I wanted to
I trying to connect to a Java Service with some special security requirements It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.