Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7606591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:26:55+00:00 2026-05-31T00:26:55+00:00

I’m having trouble making a connection to Amazons RDS service from my Codeigniter application.

  • 0

I’m having trouble making a connection to Amazons RDS service from my Codeigniter application.

Settings in database config:

$db['default']['ssl_set'] = TRUE;
$db['default']['ssl_key'] = NULL;
$db['default']['ssl_cert'] = NULL;
$db['default']['ssl_ca'] = realpath('./application/third_party/mysql-ssl-ca-cert.pem');
$db['default']['ssl_capath'] = NULL;
$db['default']['ssl_cipher'] = NULL;

However, when I connect. I get the message:

Unable to select the specified database: Staging
Filename: …\system\database\DB_driver.php
Line Number: 140

Line 40 is shown here:

    // Select the DB... assuming a database name is specified in the config file
    if ($this->database != '')
    {
        if ( ! $this->db_select())
        {
            log_message('error', 'Unable to select database: '.$this->database);

            if ($this->db_debug)
            {
                $this->display_error('db_unable_to_select', $this->database); // LINE 140
            }
            return FALSE;
        }

I made the following changes to get mysqli working with SSL:

I’m suprised it connected successfully as its complaining about database selection. Not sure where to go from here though?

I’m using PHP 5.3.8 on a windows machine.

Update

This is turning more into a bug than a problem with my implementation. If I set the $db['default']['db_debug'] to false. I don’t get that problem anymore. However, I get a bunch warnings to do with:

Severity: Warning
Message: mysqli_real_escape_string() [function.mysqli-real-escape-string]: invalid object or resource mysqli
Filename: mysqli/mysqli_driver.php
Line Number: 346

Which means there was an unsuccessful connection to the database over SSL.

Update 2

I am using XAMPP.

And I am using Codeingiter 2.0.2.

Update 3

My database config file:

$db['default']['hostname'] = 'xxxx.us-east-1.rds.amazonaws.com';
$db['default']['username'] = 'xxxxx';
$db['default']['password'] = 'xxxx';
$db['default']['database'] = 'xxxx';
$db['default']['dbdriver'] = 'mysqli';
$db['default']['port'] = 3306;
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = true;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
$db['default']['ssl_set'] = true; 
$db['default']['ssl_key'] = NULL;
$db['default']['ssl_cert'] = NULL;
$db['default']['ssl_ca'] = realpath('./application/third_party/mysql-ssl-ca-cert.pem');
$db['default']['ssl_capath'] = NULL;
$db['default']['ssl_cipher'] = NULL;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T00:26:56+00:00Added an answer on May 31, 2026 at 12:26 am
    $db['default']['port'] = 3306;
    

    Try adding that to db config. mysql_real_connect() expects param 6 to be a LONG int; balks at empty string.


    Update

    The function below line 140 in DB_Driver is where the dbcollat and charset are set. Those will hit real_escape in the driver, and cause the escape_error if not correct.

    Try

    $db['default']['dbcollat']='';
    

    Or, check that the encoding your db is set for what you have in your db config. i.e. if your db charset is latin1 and you are using utf-8, the conn_id will be wrong and mysqli_escape will balk.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.