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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:58:01+00:00 2026-06-03T21:58:01+00:00

I recently created a webpage, while using an usbWebserver, so basically a local server.

  • 0

I recently created a webpage, while using an usbWebserver, so basically a local server.
Yesterday, I have purchased a domain and hosting, and I wanted to move my files onto the server.

I have changed my username, password and url, however I cannot get the mysql_connect to work.

<?php

    $mysqlhost = "mysql04.totaalholding.nl"; 
    $user = "a";
    $passwd = "";


    $mysql = mysql_connect($mysqlhost, mysql_real_escape_string($user), mysql_real_escape_string($passwd));
    if (!$mysql) {
        die('Could not connect: ' . mysql_error());
    }

    $db_selected = mysql_select_db('a_turfjes', $mysql);
    if (!$db_selected) {
        die('Could not connect: ' . mysql_error());
    }

?>

The above code is how I connect to the database, which should work. (please note that a is not my username and neither is my password empty).

These are the properties of the database:

DATABASE: a_turfjes

Extern MySQL Host: mysql04.totaalholding.nl

Users: a_admin

I am not quite sure which username to use should I use the username and password from cpanel (which is required to access PHPMyAdmin), or the username and password, which is the user of the database itsself.

I’d like some help on this error. When accessing my index.php (which includes db.php (which is the file above)), I receive the following errors:

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'root'@'localhost' (using password: NO) in /home/a/public_html/turfjes/db.php on line 8

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /home/a/public_html/turfjes/db.php on line 8

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'root'@'localhost' (using password: NO) in /home/a/public_html/turfjes/db.php on line 8

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /home/a/public_html/turfjes/db.php on line 8

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'www30.totaalholding.nl' (using password: NO) in /home/a/public_html/turfjes/db.php on line 8
Could not connect: Access denied for user 'root'@'www30.totaalholding.nl' (using password: NO)
  • 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-03T21:58:02+00:00Added an answer on June 3, 2026 at 9:58 pm

    Use the username and password of the database itself not the cpanel.

    Test connection using:

    $mysql_host = "localhost"; # Usually doesn"t need modified
    $mysql_db = "a_turfjes"; # Database name
    $mysql_user = ""; # Username
    $mysql_pass = ""; # Password
    $link = mysql_connect ($mysql_host,$mysql_user,$mysql_pass);
    if (!$link) {
      die('Could not connect: ' . mysql_error());
    }
    echo 'Connected successfully';
    mysql_close($link);
    

    If successful, access records:

    $query = "SELECT * FROM TableName";
    $result = mysql_db_query ($dbname, $query, $link); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

recently i created a webpage, where in i have a img tag, whose source
I have recently created an upload function, but I don't know how to change
I have registered a domain in iPage.com. But recently i learnt that they are
I have recently created a student organization website (i.e. www-sc.xxx.edu/studentorganizations/ourorganization). Our college does not
I recently created a ListView using ListAdapter and applied a static background image behind
I recently created a turn-based game server that can accept 10s of thousands of
I have recently created a Universal App in Xcode 4 to build my new
I recently created a domain and sub-domain via cPanel, and for some reason I
I recently created a project (open source) on Google projects hosting. I want to
I have recently created an EC2 account on Amazon Web Services. I have created

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.