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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:58:36+00:00 2026-05-14T06:58:36+00:00

I am trying to connect to mysql and am getting an error. I put

  • 0

I am trying to connect to mysql and am getting an error.
I put my servers ip address in and used port 3306 whihch post should be used?

<?php

$connection = mysql_connect("serer.ip:port", "user", "pass")
 or die(mysql_error());

 if ($connection) {$msg = "success";}
?>

<html>
<head>
</head>
<body>

<? echo "$msg"; ?>

</body>
</html>

Here is the error its producing:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘user’@’localhost’ (using password: YES) in /home/admin/domains/domain.com.au/public_html/db_connect.php on line 3
Access denied for user ‘user’@’localhost’ (using password: YES)

  • 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-05-14T06:58:36+00:00Added an answer on May 14, 2026 at 6:58 am

    Use

    $conn = mysql_connect($db_host,$db_user, $db_pass) or die("Error connecting to database");
    

    The port is automatically selected as 3306.

    Also double check to make sure your username and password for connecting are correct and allowed access.

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

Sidebar

Related Questions

im getting this error while trying to connect a mysql database to an editor,
I'm trying to connect to remote MySQL server with SSL from PHP using mysql_connect:
i get this following error when i am trying to connect my localhost mysql
I am trying to connect to a mysql database within a php script. So
Getting an PDO error when trying to do php symfony doctrine:insert-sql The error I
I am trying to connect to a remote MySQL database via PHP that is
I am trying to connect my PHP code to MySQL safely with the following
I am trying to configure MySQL to be used with PHP and Apache. But
Hi am using MS visual VC++ 2008 trying to connect mysql though vc++ code..getting
Im trying to connect MySql from VB.NET in visual basic 2010. I wanted to

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.