Category Archives: amazon-rds

Error using phpMyAdmin with Amazon RDS

We have an Amazon RDS instance and I want to manage it with phpMyAdmin.

I've got phpMyAdmin running, but there seems to be issues with the configuration I can't figure out.

My setup:

  • Ubuntu 14.04
  • PHP 7.0
  • Apache 2.4
  • phpMyAdmin 4.6.2

I did not install phpMyAdmin with apt-get because it was going to install PHP5 and MySql stuff. So I downloaded it from their site.

My config.inc.php below:

<?php

$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

$i = 0;

$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'path.to.rds.amazon.com';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;

I did not make other changes elsewhere. I did not create any phpmyadmin database. Because I read some blogs that the issue is with the database structure but I can't find the script that creates phpmyadmin defaults.

I'm getting the errors below when I login to phpMyAdmin:

The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. Find out why.
      Or alternately go to 'Operations' tab of any database to set it up there.

clicking on Find out why would say this:

Configuration of pmadb… not OK
General relation features Disabled

and this other error

The configuration file now needs a secret passphrase (blowfish_secret).

and when I navigate in phpMyAdmin, it displays 403-forbidden, a phpmyadmin pop-up. Not the web server 403 page.

Can someone please point me to the right direction. I can't seem to find what's wrong with the config.inc.php.

Thanks!

Accessing an Amazon RDS MySQL database from CodeIgniter leads a blank display

This is related to this previous question. I'm making it a new question because at this point I believe it's a database access issue.

Essentially, I've switched the database from a MySql sever to an Amazon RDS MySql server, due to server migration. To summarize, I'm attempting to migrate a PHP site based on CodeIgniter (version 1.7.2) to a new server which has AmazonLinux as the OS. The previous server was Ubuntu, running PHP 5.3.3-1ubuntu9.5 on Apache2. The PHP version on the new AmazonLinux server is 5.3.29, running on httpd.

The problem is, when I try to access the URL in the new server, I get a blank display. The code is stopping in system/core/CodeIgniter.php at this line:

$CI = new $class();

The last line of the application log is this:

DEBUG - 2015-04-25 17:17:58 --> Database Driver Class Initialized

So, it's happening around the database. I've also read that you get a blank display if it's a database issue due to an "@" being used for database-related messages.

These are the settings in database.php:

$active_group = "default";
$active_record = TRUE;
$db['default']['hostname'] = "xxxxx.xxxxxxxx.us-east-1.rds.amazonaws.com";
$db['default']['username'] = "xxxxx";
$db['default']['password'] = "xxxxx";
$db['default']['database'] = "xxxxx";
$db['default']['dbdriver'] = "mysql";
$db['default']['port'] = 3306;
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = "TRUE";
// $db['default']['cache_on'] = FALSE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "/opt/xxxxx/cachedb/";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

I also tried it without the port specified (as it's set up on the current production site) as well as with the port specified at the end of the url:

$db['default']['hostname'] = "xxxxx.xxxxxxxx.us-east-1.rds.amazonaws.com:3306";

But I'm still getting the blank display.

We have a Java/Tomcat application running on the same server that is able to access the RDS database, using the same url, name and password, so it doesn't appear to be an issue of security groups.

Any thoughts on what the problem might be? and if so how to solve?

Edit 1: I've tracked down the problem - not surprisingly, it's the database driver. It fails when calling this function: system/database/drivers/mysqli/mysqli_driver.php: function db_pconnect()

The question is, can I just copy in a more recent driver into this older version of CodeIgnitor and it will miraculously work? I'll try that experiment tomorrow. Otherwise, we might be looking at an upgrade. Grim, but it should theoretically work, since it will have an up-to-date driver. Right?