rudranm

Topic: Access denied for user-error

URL: jobs.goaheadconsulting.co.uk Hosting: 1and1

Warning: mysqli::mysqli() [mysqli.mysqli]: (42000/1044): Access denied for user 'dbo310272272'@'%' to database 'jobberbase' in /homepages/29/d253652778/htdocs/Jobs/_includes/class.Db.php on line 20

Warning: mysqli::query() [mysqli.query]: Couldn't fetch Db in /homepages/29/d253652778/htdocs/Jobs/_includes/class.Db.php on line 72

Warning: mysqli_error() [function.mysqli-error]: Couldn't fetch Db in /homepages/29/d253652778/htdocs/Jobs/_includes/class.Db.php on line 73

Warning: mysqli::query() [mysqli.query]: Couldn't fetch Db in /homepages/29/d253652778/htdocs/Jobs/_includes/class.Db.php on line 31

Warning: mysqli_error() [function.mysqli-error]: Couldn't fetch Db in /homepages/29/d253652778/htdocs/Jobs/_includes/class.Db.php on line 32

Fatal error: Call to a member function fetch_assoc() on a non-object in /homepages/29/d253652778/htdocs/Jobs/_includes/class.JobberSettings.php on line 23

please advise, database user & password is correct, database name is ok everywhere.

Thanks in advance

redjumpsuit

Re: Access denied for user-error

it can mean that the sql user's password is invalid. can you post your config.php file here?

will host your job board for you at minimal cost! read more: http://mim.io/acb992

rudranm

Re: Access denied for user-error

Many Thanks...

Please see the config.php details below

<?php
/**
* jobber job board platform
*
* @author     Filip C.T.E. <http://www.filipcte.ro> <me@filipcte.ro>
* @license    You are free to edit and use this work, but it would be nice if you always referenced the original author wink
*             (see license.txt).
*/
 
    header('Content-Type: text/html; charset=UTF-8');
      ini_set('display_errors', 'on');
    error_reporting(E_ALL ^ E_STRICT);
   
    date_default_timezone_set('Europe/Bucharest');
   
    define('JOBBERBASE_VERSION', '1.8');

    // MySQL + misc settings for local environment
    if ($_SERVER['SERVER_NAME'] == 'localhost')
    {
        define('DB_HOST', 'localhost');
        define('DB_PORT', 3306);
        define('DB_USER', 'root');
        define('DB_PASS', '');
        define('DB_NAME', 'jobberbase');
        define('DB_PREFIX', '');
        define('LOCATION', 'local');
        define('ENVIRONMENT', 'dev');
    }
    // MySQL + misc settings for production environment
    else
    {
        define('DB_HOST', 'db821.oneandone.co.uk');
        define('DB_PORT', 3306);
        define('DB_USER', 'dbo310272272');
        define('DB_PASS',  'babuni1');
        define('DB_NAME', 'jobberbase');
        define('LOCATION', 'online');
        define('DB_PREFIX', '');
        define('ENVIRONMENT', 'prod');
    }

    define('APP_PATH',dirname(__FILE__).DIRECTORY_SEPARATOR);

  if(isset($_SERVER['SCRIPT_NAME']))
    {
        # on Windows _APP_MAIN_DIR becomes \ and abs url would look something like HTTP_HOST\/restOfUrl, so \ should be trimed too
        # @modified Chis Florinel <chis.florinel@candoo.ro>
       
        $app_main_dir = rtrim(dirname($_SERVER['SCRIPT_NAME']),'/\\');   
        define('_APP_MAIN_DIR', $app_main_dir);
  }
    else
    {
        die('[config.php] Cannot determine APP_MAIN_DIR, please set manual and comment this line');
  }

  if(isset($_SERVER['HTTP_HOST']) && isset($_SERVER['SERVER_PORT']))
    {
      if($_SERVER['SERVER_PORT'] == 80)
    {
      define ('BASE_URL', 'http://' . $_SERVER['HTTP_HOST'] . _APP_MAIN_DIR . '/');
    }
    else
    {
      define ('BASE_URL', 'http://' . $_SERVER['HTTP_HOST'].':'.$_SERVER['SERVER_PORT'] . _APP_MAIN_DIR . '/');
    }
  }
  else
  {
    die('[config.php] Cannot determine BASE_URL, please set manual and comment this line');
  }
   
    // Function and classes includes
    require_once '_includes/function.validate_email.php';
    require_once '_includes/function.redirect_to.php';
    require_once '_includes/function.printr.php';
    require_once '_includes/function.escape.php';
    require_once '_includes/functions.php';
    require_once '_includes/recaptchalib.php';
    require_once '_includes/class.phpmailer.php';
    require_once '_includes/class.Postman.php';
    require_once '_includes/class.Textile.php';
    require_once '_includes/class.Sanitizer.php';
    require_once '_includes/class.Db.php';
    // comment the previous line and uncomment the next line if you get a Class 'mysqli' not found error
    // require_once '_includes/class.Db.MySql.php';
    require_once '_includes/class.Job.php';
    require_once '_includes/class.Paginator.php';
    require_once '_includes/class.Feed.php';
    require_once '_includes/class.SpamReport.php';
    require_once '_includes/class.Api.php';
    require_once '_includes/class.JobApplication.php';
    require_once '_includes/class.SearchKeywords.php';
    require_once '_includes/class.JobberSettings.php';
    require_once '_includes/class.FormValidator.php';
    require_once '_includes/smarty/libs/Smarty.class.php';

    // Setup database connection
    try
    {
        $db = new Db(DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT);
        $db->Execute('SET NAMES UTF8');
    }
    catch(ConnectException $exception)
    {
        if (ENVIRONMENT == 'dev')
        {
            echo "Database Connection Error:<br />";
            printr($exception->getMessage());   
        }
    }
   
    // Load the Site-Specific Settings
    $jobber_settings = new JobberSettings();
    $settings = $jobber_settings->GetSettings();
   
    // Global settings definitions
    define('SITE_NAME', $settings['site_name']);
    define('THEME', $settings['theme']);
    define('NOTIFY_EMAIL', $settings['notify_email']);
    define('ADMIN_EMAIL', $settings['admin_email']);
    define('MAX_CV_SIZE', $settings['max_cv_size']);
    define('FILE_UPLOAD_DIR', $settings['file_upload_dir']);
    define('MINUTES_BETWEEN_APPLY_TO_JOBS_FROM_SAME_IP', $settings['apply_delay']);
    define('OLD_JOB_NOTIFY', $settings['old_job_notify']);
    define('ENABLE_NEW_JOBS', $settings['enable_new_jobs']);
    define('JOBS_PER_PAGE', $settings['jobs_per_page']);
    define('SIDEBAR_SHOW_WHAT', $settings['sidebar_show_what']);
    define('SIDEBAR_ONLY_CITIES_WITH_JOBS', $settings['sidebar_only_cities_with_jobs']);
    define('DATE_FORMAT', $settings['date_format']);
    define('DATE_TIME_FORMAT', $settings['date_time_format']);
    define('URL_JOB', $settings['url_job']);
    define('URL_JOBS', $settings['url_jobs']);
    define('URL_CITIES', $settings['url_cities']);
    define('URL_COMPANIES', $settings['url_companies']);
    define('URL_JOBS_IN_CITY', $settings['url_jobs_in_city']);
    define('URL_JOBS_AT_COMPANY', $settings['url_jobs_at_company']);
    define('SEARCH_METHOD', $settings['search_method']);
    define('SEARCH_RESULTS_PER_PAGE', $settings['jobs_per_search']);
    define('SEARCH_AMOUNT_PAGES', '8'); //Max. pages to display (must be an even number!)
    define('ENABLE_RECAPTCHA', $settings['enable_recaptcha']);
    define('CAPTCHA_PUBLIC_KEY', $settings['captcha_public_key']);
    define('CAPTCHA_PRIVATE_KEY', $settings['captcha_private_key']);
   
    // Setup Smarty
    $smarty = new Smarty();
    $smarty->template_dir = APP_PATH . '_templates/' . THEME . '/';
    $smarty->compile_dir = APP_PATH . '_templates/' . THEME . '/_cache/';
   
    // Create Textile object
    $textile = new Textile;
   
    // Split URL - get parameters
    $_app_info['params'] = array();
   
    // if your server is IIS, use these lines and comment lines 135-137:
    //$_url = $_SERVER["QUERY_STRING"];

    // if server is Apache:   
    $newUrl = str_replace('/', '\/', _APP_MAIN_DIR);
    $pattern = '/'.$newUrl.'/';   
    $_url = preg_replace($pattern, '', $_SERVER['REQUEST_URI'], 1);
    $_tmp = explode('?', $_url);
    $_url = $_tmp[0];   
   
    if ($_url = explode('/', $_url))
    {
        foreach ($_url as $tag)
        {
            if ($tag)
            {
                $_app_info['params'][] = $tag;
            }
        }
    }
?>

redjumpsuit

Re: Access denied for user-error

thanks for the reply. are you able to connect to your database using external mysql client (like sqlyog) without problems? it could be port settings. try to verify with your web hosting smile

i've done many installations on InMotion or JustHost and never encountered problems smile

will host your job board for you at minimal cost! read more: http://mim.io/acb992

muzaffarab

Re: Access denied for user-error

url: jobs.jobnath.in

hosting: x10hosting

ERROR:

Warning: mysqli::mysqli() [mysqli.mysqli]: (28000/1045): Access denied for user 'root'@'web1.vital.x10hosting.com' (using password: NO) in /home/jobanth/public_html/jobs/_includes/class.Db.php on line 20
Database Connection Error:
Debug
Access denied for user 'root'@'web1.vital.x10hosting.com' (using password: NO)

Fatal error: Call to a member function query() on a non-object in /home/jobanth/public_html/jobs/_includes/class.JobberSettings.php on line 19




config.php file:





<?php
/**
* Config - jobber job board platform
*
* @author     Filip C.T.E. <http://www.filipcte.com> <filipcte@gmail.com>
* @license    You are free to edit and use this work, but it would be nice if you always referenced the original author wink
*             (see license.txt).
*/
 
    define('APP_PATH', str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, str_replace('_config', '', dirname(__FILE__)) . DIRECTORY_SEPARATOR));

    // Environments setup
    require_once APP_PATH . '_config/config.envs.php';

    if(isset($_SERVER['SCRIPT_NAME']))
    {
        # on Windows _APP_MAIN_DIR becomes \ and abs url would look something like HTTP_HOST\/restOfUrl, so \ should be trimed too
        # @modified Chis Florinel <chis.florinel@candoo.ro>
       
        $app_main_dir = rtrim(dirname($_SERVER['SCRIPT_NAME']),'/\\');   
        define('_APP_MAIN_DIR', $app_main_dir);
      }
    else
    {
        die('[config.php] Cannot determine APP_MAIN_DIR, please set manual and comment this line');
      }
   
   
    // Function and classes includes
    require_once APP_PATH . '_includes/class.Translator.php';
    require_once APP_PATH . '_includes/class.EmailTranslator.php';
    require_once APP_PATH . '_includes/function.validate_email.php';
    require_once APP_PATH . '_includes/function.redirect_to.php';
    require_once APP_PATH . '_includes/function.printr.php';
    require_once APP_PATH . '_includes/function.escape.php';
    require_once APP_PATH . '_includes/functions.php';
    require_once APP_PATH . '_includes/recaptchalib.php';
    require_once APP_PATH . '_includes/class.phpmailer.php';
    require_once APP_PATH . '_includes/class.Postman.php';
    require_once APP_PATH . '_includes/class.Textile.php';
    require_once APP_PATH . '_includes/class.Sanitizer.php';
    require_once APP_PATH . '_includes/class.Db.php';
    // comment the previous line and uncomment the next line if you get a Class 'mysqli' not found error
    // require_once APP_PATH . '_includes/class.Db.MySql.php';
    require_once APP_PATH . '_includes/class.Job.php';
    require_once APP_PATH . '_includes/class.Paginator.php';
    require_once APP_PATH . '_includes/class.Feed.php';
    require_once APP_PATH . '_includes/class.SpamReport.php';
    require_once APP_PATH . '_includes/class.Api.php';
    require_once APP_PATH . '_includes/class.JobApplication.php';
    require_once APP_PATH . '_includes/class.SearchKeywords.php';
    require_once APP_PATH . '_includes/class.JobberSettings.php';
    require_once APP_PATH . '_includes/class.FormValidator.php';
    require_once APP_PATH . '_includes/smarty/libs/Smarty.class.php';

    // Setup database connection
    try
    {
        $db = new Db(DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT);
        $db->Execute('SET NAMES UTF8');
    }
    catch(ConnectException $exception)
    {
        if (ENVIRONMENT == 'dev')
        {
            echo "Database Connection Error:<br />";
            printr($exception->getMessage());   
        }
    }
   
   
    // Load the Site-Specific Settings
    $jobber_settings = new JobberSettings();
    $settings = $jobber_settings->GetSettings();
   
    require_once APP_PATH . '_config/config.settings.php';
    // Setup Smarty
    $smarty = new Smarty();
    $smarty->template_dir = APP_PATH . '_templates' . DIRECTORY_SEPARATOR . THEME . DIRECTORY_SEPARATOR;
    $smarty->compile_dir = APP_PATH .'_templates' . DIRECTORY_SEPARATOR . THEME . DIRECTORY_SEPARATOR . '_cache';
   
    // Create Textile object
    $textile = new Textile;

    // Split URL - get parameters
    $_app_info['params'] = array();
   
    if (isset($_SERVER['HTTP_X_ORIGINAL_URL']))
    {
        $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL'];
    }
    if (isset($_SERVER['HTTP_X_REWRITE_URL']))
    {
        $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
    }       
    // if server is Apache:   
    if(REWRITE_MODE == 'apache_mod_rewrite' || REWRITE_MODE == 'iis_isapi_rewrite')
    {
        $newUrl = str_replace('/', '\/', _APP_MAIN_DIR);
        $pattern = '/'.$newUrl.'/';   
        $_url = preg_replace($pattern, '', $_SERVER['REQUEST_URI'], 1);
        $_tmp = explode('?', $_url);
        $_url = $_tmp[0];   
       
        if ($_url = explode('/', $_url))
        {
            foreach ($_url as $tag)
            {
                if ($tag)
                {
                    $_app_info['params'][] = $tag;
                }
            }
        }
    }
    elseif(REWRITE_MODE == 'iis_url_rewrite')
    {
        if(isset($_GET['page']))
            $_app_info['params'][]  = $_GET['page'];
        if(isset($_GET['id']))
            $_app_info['params'][]  = $_GET['id'];
        if(isset($_GET['extra']))
            $_app_info['params'][]  = $_GET['extra'];
    }
   
    $page = (isset($_app_info['params'][0]) ? $db->real_escape_string($_app_info['params'][0]) : '');
    $id = (isset($_app_info['params'][1]) ? $db->real_escape_string($_app_info['params'][1]) : 0);
    $extra = (isset($_app_info['params'][2]) ? $db->real_escape_string($_app_info['params'][2]) : '');
   
   
    date_default_timezone_set('Europe/London');
    header('Content-Type: text/html; charset=UTF-8');
    session_start();
?>














Please provide me with the solution at

info@jobnath.in

Please help me guys/....

putypuruty

Re: Access denied for user-error

From you error log, it is obvious that the user/password combination is wrong - it says Access denied and it also tells you that no password was set for the root user. I doubt that you can connect without having a password set.

You should review the config.envs.php file to be sure that the database credentials are correct.