Intranet Journal

Go Back   IT Management Forum > Intranet Journal

Intranet Journal The new discussion forum for Intranet Journal readers. Leave comments and questions for IJ authors. Suggest story ideas and provide feedback.

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-17-2008, 05:54 AM
Spekta Spekta is offline
Registered User
 
Join Date: Sep 2008
Posts: 1
Content Management System MYSQL error

I'm not a pro at this stuff but i did the first 3 parts and get this error


Code:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/jaygewxz/public_html/includes/DbConnector.php on line 26

Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/jaygewxz/public_html/includes/DbConnector.php on line 27

Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /home/jaygewxz/public_html/includes/DbConnector.php on line 27

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/jaygewxz/public_html/includes/DbConnector.php on line 36

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/jaygewxz/public_html/includes/DbConnector.php on line 43

Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /home/jaygewxz/public_html/includes/DbConnector.php on line 50
But i can guarantee ive put in the proper info.

Here's my dbconnector.php

Code:
<?php
////////////////////////////////////////////////////////////////////////////////////////
// Class: DbConnector
// Purpose: Connect to a database, MySQL version
///////////////////////////////////////////////////////////////////////////////////////
require_once 'SystemComponent.php';

class DbConnector extends SystemComponent {

var $theQuery;
var $link;

//*** Function: DbConnector, Purpose: Connect to the database ***
function DbConnector(){

// Load settings from parent class
$settings = SystemComponent::getSettings();

// Get the main settings from the array we just loaded
$host = $settings['localhost'];
$db = $settings['jaygewxz_cms'];
$user = $settings['jaygewxz_spekta'];
$pass = $settings['pword'];

// Connect to the database
$this->link = mysql_connect($host, $user, $pass);
mysql_select_db($db);
register_shutdown_function(array(&$this, 'close'));

}

//*** Function: query, Purpose: Execute a database query ***
function query($query) {

$this->theQuery = $query;
return mysql_query($query, $this->link);

}

//*** Function: fetchArray, Purpose: Get array of query results ***
function fetchArray($result) {

return mysql_fetch_array($result);

}

//*** Function: close, Purpose: Close the connection ***
function close() {

mysql_close($this->link);

}


}
?>
Reply With Quote
  #2 (permalink)  
Old 09-18-2008, 06:32 AM
david_g17 david_g17 is offline
Registered User
 
Join Date: Sep 2008
Posts: 1
Code:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/jaygewxz/public_html/includes/DbConnector.php on line 26
This error means that you are trying to connect to MySQL with a user name of "nobody" and without a password.

In order to successfully do that, you'll need to create a user with access privileges to the database you wish to connect to.

For instance, if I wanted user "nobody" to connect to a database named "my_database", and I wanted this user to be able to select, update, delete, etc. I would execute the following MySQL command
Code:
GRANT ALL ON my_database.* to 'nobody'@'localhost' ;
at the MySQL prompt (you can probably do this through a graphical user interface if your host is using PHPMyAdmin or something similar).

If I wanted the user to use the password "s3cr3t", I would issue the following command:
Code:
GRANT ALL ON my_database.* to 'nobody'@'localhost'  identified by 's3cr3t';
More details can be found here:

http://dev.mysql.com/doc/refman/5.0/en/adding-users.
Reply With Quote
  #3 (permalink)  
Old 12-16-2008, 03:06 PM
roberto roberto is offline
Registered User
 
Join Date: Dec 2008
Posts: 1
I am having this same problem except that when I try to

Quote:
GRANT ALL ON my_database.* to 'myusername'@'localhost' identified by 'mypassword';
I get:
Quote:
#1044 - Access denied for user 'myusername'@'localhost' to database 'my_database'
I am using phpmyadmin, what should I do now?
Reply With Quote
  #4 (permalink)  
Old 01-06-2009, 07:54 AM
jaison jaison is offline
Registered User
 
Join Date: Mar 2008
Posts: 5
refer this site http://www.php-mysql-tutorial.com/wi...and-mysql.aspx u may get some thing more
Reply With Quote
  #5 (permalink)  
Old 01-07-2009, 12:24 PM
greenland greenland is offline
Registered User
 
Join Date: Jan 2009
Posts: 1
hi there,
you need to edit database connection in file: SystemComponent.php
remember this is class infor login database by user and password,
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 04:13 PM.





Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0