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 8907557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:56:53+00:00 2026-06-15T02:56:53+00:00

I am using the libmysql C API, the mysql_real_connect call only works if I

  • 0

I am using the libmysql C API, the mysql_real_connect call only works if I use the real IP address of the host – other than localhost. If I use localhost as host I get the
following error:

ERROR 2003 (HY000): Can’t connect to MySQL server on ‘localhost’ (0)

The authentication should be ok, since the used user has all privileges from localhost and any host also.

By the way it is an XAMPP installation on Windows 7.

  • 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-15T02:56:54+00:00Added an answer on June 15, 2026 at 2:56 am

    I had the same problem and the solution is to uninstall and disable IPv6 support, because if I had IPv6 support enabled then ping localhost command returns ::1: instead 127.0.0.1 as i have written in etc\hosts file, and sample mysql connect program written in C using libmysql do not connect when as host parameter to mysql_real_connect() i supplied “localhost”. Now, after disabling IPv6 works both options (“localhost” or “127.0.0.1”).

    P.S.: I have tried this “solution” only in Windows XP SP3 Pro Czech. In Windows 7 and Linux I don’t try this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Delphi 7 Personal. To access MySQL database I'm using libmysql.dll + very
Im using this code for mysql connection $con = mysql_connect(localhost:/var/lib/mysql/mysql.sock, abc , xyz); if
Using the Redis info command, I am able to get all the stats of
Using Location.getBearing(); I seem to get randomly changing bearings. Aka, I can turn the
I have a sortable list using JQueryUI and use the JQuery Each function to
I've been trying to use MySQL and C++ together but can't seem to get
I am using MYSQL server 5.5.15 with workbench installed When i use RADPHP xe2
I'm having trouble with the MySQLdb module. db = MySQLdb.connect( host = 'localhost', user
I am using the MySQL Embedded Library and using P/Invoke to call the necessary
I tried creating a SSH tunnel using ssh -L 3306:localhost:22 <hostip> Then running my

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.