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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:28:26+00:00 2026-05-18T23:28:26+00:00

Hey guys, I’m just starting out with MySQL and PHP and have a question.

  • 0

Hey guys, I’m just starting out with MySQL and PHP and have a question.

So I went to PHPmyAdmin and created a database. In that data base i created a Table.

Now I want to access the table with PHP and i use the following code:

<?php
$con = mysql_connect("localhost","username_of_my_database","password_of_my_database");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
?>

However, I get this error:

Warning: mysql_connect()
[function.mysql-connect]: Access
denied for user
‘username_of_my_database’@’localhost’
(using password: YES) in
/home/user_of_my_database/public_html/mywebsite.com/facebook/home.php
on line 3 Could not connect: Access
denied for user
‘username_of_my_database’@’localhost’
(using password: YES)

So the log in data are wrong. My question is: How do you get the right log in data? What do i have to fill in instead of what i did?

Thanks a lot for your help!

So what should i use: My username is: javaaa, my database is called: new year, which make for javaaa_newyear? and the password was made when making the new year database. And within the new year database there is a table called: party.

  • 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-18T23:28:26+00:00Added an answer on May 18, 2026 at 11:28 pm

    One of the parameters must be incorrect.

    Remember that ideally your webserver and database should be on different servers. If this is the case then “localhost” will not be the correct host for your database and this will mean that you are logging into the wrong database – try to find out the correct IP address or hostname for your database server (not your web server) and use that instead.

    If the hostname is correct then it must be an incorrect user name or password.

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

Sidebar

Related Questions

Hey guys, I'm just starting out with GWT and am getting the following error
Hey guys i have a question here, How do i create a body that
hey guys how to make these php html links codes possible. i have tried
Hey guys I just noticed that my join statement here SELECT * FROM reports
Hey guys I have my script here that is supposed to do some stuff
Hey guys here is my question. im using JCombobox. if a student have CB
Hey guys, I have a raidan style 2d flying/fighter game that im working on.
Hey guys, I have created a tree which is not a binary tree. Now,
hey guys, I have mypage.com/user-login.php?action=register and I want to be able to call mypage.com/register
hey guys, I have an input field that looks for matched characters on a

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.