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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:44:05+00:00 2026-05-27T20:44:05+00:00

Ok, I have a really stupid problem here, and I’m starting to get really

  • 0

Ok, I have a really stupid problem here, and I’m starting to get really upset.

Just a few minutes ago, I could run my website on localhost with no problems. It’s running in apache2 on the same machine as mySQL (an Ubuntu box).

I changed PHP’s timezone and file upload size limit, then restarted both apache and mysql.

Now when I try to run the site from apache on the server, it can no longer select the database. As far as I can tell, it doesn’t have a problem actually connecting to mysql, but when I run mysql_selectdb, it doesn’t work.

If I run this site from my laptop, connecting to it via my home network, it works flawlessly.

I’m really really frustrated right now because it was working just fine minutes ago. I don’t remember even changing any mySQL settings.

Can someone please help me figure out how this happened, and how to fix it? I really need to get this working as soon as possible.

EDIT: Here’s the code I’m using to connect:

mysql_connect($serverUrl,'xx','xxx');
@mysql_selectdb('mydatabase') or die(mysql_error());

EDIT 2: When I use the root user login, it works just fine. To the best of my knowledge, I have given root access to the user I was using before, but I guess I could be wrong. Here is the command I was using in mySQL to give access:

GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost';
  • 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-27T20:44:06+00:00Added an answer on May 27, 2026 at 8:44 pm

    the user i’m using is definitely not ‘www-data’.

    My guess is you’re using one of the mysql_* functions before you establish the connection. That will make the mySQL library use default login data – which, in your case, fail.

    Check out the file name and line number of your error message to see where it gets triggered.

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

Sidebar

Related Questions

This probably sounds really stupid but I have noo idea how to implement jquery's
This is probably a really stupid MSBuild question but if I have <ItemGroup> <Dll
I have really basic question. How can I get form id by input element
this is probably a really stupid problem, but i've been looking at it for
I have a strange problem which probably has a very simple solution, I just
OK - Python newbie here - I assume I am doing something really stupid,
I have some really weird crash here, ive got it before, but i thought
I feel really stupid for asking this but I have been thrashing for over
I have what is probably a really simple, studid question but I can't find
I have really no idea why I'm asking this as this a really completely

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.