Warning: mysql_connect(): ProxySQL Error: Access denied for user

Hi,
I’ve some problem with my website. I try to connect it to Mysql. In manual with PhpMyAdmin, there is no problem but when I try to use directly on site, there is an error :

Warning: mysql_connect(): ProxySQL Error: Access denied for user ‘id2869999_ text’@‘596332::a’

my code:

var $connect_id;
var $type;

function open($database, $host, $user, $password) {

$this->connect_id=mysql_connect($host, $user, $password);

if ($this->connect_id) {
  $result=@mysql_select_db($database);
  if (!$result) {
    @mysql_close($this->connect_id);
    $this->connect_id=$result;
  }
  return $this->connect_id;
}
else{
  return 0;
}

}

this code work with wampserver

Could you help me, please ?

Are you using the correct database,username,host and password?
Database and username looks like id_
Host is localhost

Hi, thank you for your message.

I defined informations with the database control panel. I use the same parameters in local and it works.

  $dbName='db name';

$dbUser=‘user’;
$dbPass=‘password’;
$dbServer=‘localhost’;

// create database classes
$DB = new db();
$DB->open($dbName, $dbServer, $dbUser, $dbPass); //OK
$q = new query($DB);

Is there a parameter to enter in htaccess to add ?

@playmo44 If you’re using “mysql_connect”, then make sure that you’re using Php version 5.4.

Also make sure you’re using this “‘id2869999_ text’” as user.

I used this code since PHP 3 and it works well on local with php 5.2.6.

Name of database and user begin both by > id204…2_text. But, I’ve changed the 2 values for test and it doesn’t work in local and online.

Try this if you’re using php<5.3
Create a file and call it dbconnect.php then add the following

<?php

 // this will avoid mysql_connect() deprecation error.
 error_reporting( ~E_DEPRECATED & ~E_NOTICE );
 // but I strongly suggest you to use PDO or MySQLi.
 
 define('DBHOST', 'localhost');
 define('DBUSER', 'id2049672_admilo');
 define('DBPASS', 'YOU PASWORD GOES HERE');
 define('DBNAME', 'id2049672_ilotdb');
 
 $conn = mysql_connect(DBHOST,DBUSER,DBPASS);
 $dbcon = mysql_select_db(DBNAME);
 
 if ( !$conn ) {
  die("Connection failed : " . mysql_error());
 }
 
 if ( !$dbcon ) {
  die("Database Connection failed : " . mysql_error());
 }

And at the top of each page:

include_once(‘dbconnect.php’);

Hi, thanks for your answer.

I try your code but it doesn’t work neither online nor on local.

Online, I’ve this message :slight_smile:

Notice: Undefined variable: dbName in /mypath/public_html/include/lib_config.phpa on line 19 Notice: Undefined variable: dbServer in /mypath/public_html/include/lib_config.phpa on line 19 Notice: Undefined variable: dbUser in /mypath/public_html/include/lib_config.phpa on line 19 Notice: Undefined variable: dbPass in /mypath/public_html/include/lib_config.phpa on line 19 Warning: mysql_connect(): ProxySQL Error: Access denied for user ‘root’@‘2a0…0d::a’ (using password: NO) in /mypath/public_html/include/lib_mysqldb.phpa on line 23 Notice: Undefined variable: couleur_fond_page in /mypath/public_html/include/lib_config.phpa on line 87 Notice: Undefined variable: couleur_texte in /mypath/public_html/include/lib_config.phpa on line 101 Warning: mysql_connect(): ProxySQL Error: Access denied for user ‘id2049672_ admilo’@‘2a02…d:f00d::a’ (using password: YES) in /mypath/public_html/include/dbconnect.php on line 12 Warning: mysql_select_db(): ProxySQL Error: Access denied for user ‘root’@‘2a0…ad:f00d::a’ (using password: NO) in /mypath/public_html/include/dbconnect.php on line 13 Warning: mysql_select_db(): A link to the server could not be established in /mypath/public_html/include/dbconnect.php on line 13 Connection failed : ProxySQL Error: Access denied for user ‘root’@‘2a0…:f00d::a’ (using password: NO)

Perhaps there’s a parameters to activate ?

Hi,

sorry…

In fact there is a space in the name of but on local database there’s the same error.

Thanks for yours answers.

MySQL servers are being worked on currently this could be root cause of issue here.