Jump to content

Access denied for user 'SYSTEM'@'localhost' (using password: NO) whats this??


rainprop

Recommended Posts

hi,

can someone pls help me..

without solving this im not able to continue to the next step.

 

this error seems to come when i try to log in.

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'SYSTEM'@'localhost' (using password: NO) in C:\wamp\www\login-exec.php on line 15

Failed to connect to server: Access denied for user 'SYSTEM'@'localhost' (using password: NO)

 

how to solve this??

 

this is the coding that i've put, which causes this error.

 

<?php

session_start();

 

require_once('config.php');

 

$errmsg_arr = array();

 

$errflag = false;

 

$link = mysql_connect('localhost');

if(!$link) {

die('Failed to connect to server: ' . mysql_error());

}

 

$db = mysql_select_db('payroll4');

if(!$db) {

die("Unable to select database");

}

 

function clean($str) {

$str = @trim($str);

if(get_magic_quotes_gpc()) {

$str = stripslashes($str);

}

return mysql_real_escape_string($str);

}

 

$login = clean($_POST['login']);

$password = clean($_POST['password']);

 

if($login == '') {

$errmsg_arr[] = 'Login ID missing';

$errflag = true;

}

if($password == '') {

$errmsg_arr[] = 'Password missing';

$errflag = true;

}

 

if($errflag) {

$_SESSION['ERRMSG_ARR'] = $errmsg_arr;

session_write_close();

header("location: login-form.php");

exit();

}

 

$qry="SELECT * FROM `user` WHERE login='login' AND password='".md5($_POST['password'])."'";

$result=mysql_query($qry);

 

if($result) {

if(mysql_num_rows($result) == 1) {

//Login Successful

session_regenerate_id();

$member = mysql_fetch_assoc($result);

$_SESSION['SESS_USER_ID'] = $member['user_id'];

$_SESSION['SESS_EMP_NAME'] = $member['emp_name'];

session_write_close();

header("location: member-index.php");

exit();

}else {

//Login failed

header("location: login-failed.php");

exit();

}

}else {

die("Query failed");

}

?>

 

thanks again.

actually this is my assignment..my lecturer have given a task to create a web-based payroll system.

im not an IT student, im doin accountancy, frankly speaking i do not know much about php. its more of a trial and error thing..

the system is not to be hosted anywhere, we just have to present it to make sure it runs..dats my another problem now.

i just did something in dreamweaver which says "create new site", and i created one as a localhost only,

im rely sorry if im wrong..

actually this is my assignment..my lecturer have given a task to create a web-based payroll system.

im not an IT student, im doin accountancy, frankly speaking i do not know much about php. its more of a trial and error thing..

the system is not to be hosted anywhere, we just have to present it to make sure it runs..dats my another problem now.

i just did something in dreamweaver which says "create new site", and i created one as a localhost only,

im rely sorry if im wrong..

 

Sorry but if this is not hosted anywhere then how is it executing the code? Whatever machine it is being run on has a server and has php installed. You need to know the username and password that belongs to whatever server it is on. Also depending on where it is that localhost might not be right as well. If you are running it on your machine though and not uploading it somewhere then localhost should be correct.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.