MySQL Forums
Forum List  »  PHP

Warning: mysql_connect()
Posted by: Ady Alex
Date: January 25, 2018 08:06AM

Hi all

I recive this error when i tray to connect with the user and password:

Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: NO) in C:\AppServ\www\IMS\db\db.class.php on line 14
Server connection not possible.

This is my code:

class DB

var $defaultDebug = false;
var $mtStart;
var $nbQueries;
var $lastResult;
function DB($base, $server, $user, $pass)
$this->mtStart = $this->getMicroTime();
$this->nbQueries = 0;
$this->lastResult = NULL;
mysql_connect($server, $user, $pass) or die('Server connexion not possible.');
mysql_select_db($base) or die('Database connexion not possible.');

I have :
AppServ Open Project - 8.6.0 for Windows
Apache Web Server Version 2.4.25
PHP Script Language Version 5.6.30 & 7.1.1
MySQL Database Version 5.7.17
phpMyAdmin Database Manager Version 4.6.6

Options: ReplyQuote

Written By
Warning: mysql_connect()
January 25, 2018 08:06AM
January 25, 2018 08:36AM
January 25, 2018 09:04AM
January 25, 2018 12:13PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.