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.

Link to comment
Share on other sites

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..

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.