Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
February 09, 2012, 07:42:25 PM

Pages: [1]   Go Down
  Print  
Author Topic: A new Mysql database and user can't connect  (Read 1754 times)
rlischer
Trekkie
**
Offline Offline

Posts: 15


« on: March 16, 2009, 07:15:57 AM »

In cpanel my other domains don't see to have access to their mysql databases.  I added a new account, I created a MySql database and a user and gave that user ALL permissions to the new database. In PhpMyAdmin it still says "No Privileges" and in Cpanel in MySql databases is says can't connect.

PHP $dbh=mysql_connect ("localhost", "a_database",
"<PASSWORD HERE>") or die('Cannot connect to the database because: ' . mysql_error());
mysql_select_db ("a_database"); 

Any ideas?

Thanks

Logged
perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1394



« Reply #1 on: March 16, 2009, 07:43:32 AM »

Hi Rlischer,

Did you specify the username to connect to the database as in your code or was it also missed like it is in your code example?
Logged

Kind Regards,
Vlad Artamonov
rlischer
Trekkie
**
Offline Offline

Posts: 15


« Reply #2 on: March 16, 2009, 08:16:34 AM »

Yes, the only user I can ever get to connect to any database is the root.  The sample code was just what I see in cPanel when I click on MySQL.  It just seems like my other domains have no control over MySQL, only the root.

Thanks
Logged
perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1394



« Reply #3 on: March 16, 2009, 09:35:24 PM »


How do you access phpmyadmin?
Logged

Kind Regards,
Vlad Artamonov
rlischer
Trekkie
**
Offline Offline

Posts: 15


« Reply #4 on: March 17, 2009, 04:58:55 AM »

From within cPanel.  I have another server and I did the same thing and it worked fine.  For some reason it seems like when I add a database in cPanel and then add a user to the database they still have no privliges.  On my other server when I do the exact same thing they can connect to MySQL.
Logged
perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1394



« Reply #5 on: March 17, 2009, 09:40:08 PM »

Rlischer,

Can you please open a ticket with dedicated support regarding this issue by emailing dedicated@lunarpages.com. Access to the server is required to look into this further.
Logged

Kind Regards,
Vlad Artamonov
rlischer
Trekkie
**
Offline Offline

Posts: 15


« Reply #6 on: March 18, 2009, 06:16:27 AM »

I just figured something out.  I am able to use the MySQL Admin tool from my remote Windows PC to connect to the database using the username/password and make changes to the database.

This error might have nothing to do with not being able to connect:


Code:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@xxxxxxxxxxxxx.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
Logged
rlischer
Trekkie
**
Offline Offline

Posts: 15


« Reply #7 on: March 18, 2009, 07:23:25 AM »

I found a problem.  I can't view any .php file in a web brower. It has nothing to do with the database. 

Even something this lame gets me an error in the browser:

<html>
<h3>My first PHP Program</h3>
  <? echo "Hello world!"; ?>
</html>
Logged
rlischer
Trekkie
**
Offline Offline

Posts: 15


« Reply #8 on: March 18, 2009, 08:03:48 AM »

I figured it out.  It was permissions on the .php file.  I have never had to do this on any other server, but I did a chmod 700 index.php and now it works.

 Yep

« Last Edit: March 18, 2009, 11:55:44 AM by rlischer » Logged
perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1394



« Reply #9 on: March 19, 2009, 12:08:24 AM »


Good to know, Rlischer . Thanks for update.
Logged

Kind Regards,
Vlad Artamonov
Pages: [1]   Go Up
  Print  
 
Jump to: