Setting up phpmyadmin to only connect to remote server

I've been stuck on this for a while, and was hoping you could provide some insight into what I'm doing wrong.

I have a fresh amazon EC2 (Ubuntu 16.04) instance connected to an RDS (mysql) database, and am trying to install phpmyadmin on the amazon EC2 instance in order to administrate the RDS database.

What I'm having trouble with is how to configure phpmyadmin so that it doesn't install a local database, and instead simply connects to the RDS instance. (I selected no when asked if I wanted phpmyadmin to setup a db for me.)

First Attempt:

I've tried adding the following to my /etc/phpmyadmin/config.header.inc.php:

$i++;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '*************';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;

where ************* is the writer endpoint for my RDS instance.

However, doing so simply produces the following unusable login page: Borked Login Page

Second Attempt:

I also tried changing $dbserver in /etc/phpmyadmin/config-db.php to the writer endpoint for my RDS instance, which produced the following warnings on the login page:

Warning 1:

Notice in ./index.php#603
Use of undefined constant PMA_DRIZZLE - assumed 'PMA_DRIZZLE'

Backtrace

Warning 2:

Notice in ./libraries/DatabaseInterface.class.php#2665
Use of undefined constant PMA_DRIZZLE - assumed 'PMA_DRIZZLE'

Backtrace

./libraries/db_common.inc.php#24: PMA_DatabaseInterface->isSystemSchema(string '')
./db_structure.php#14: require_once(./libraries/db_common.inc.php)

Warning 3:

Notice in ./libraries/DatabaseInterface.class.php#2666
Use of undefined constant PMA_DRIZZLE - assumed 'PMA_DRIZZLE'

Backtrace

./libraries/db_common.inc.php#24: PMA_DatabaseInterface->isSystemSchema(string '')
./db_structure.php#14: require_once(./libraries/db_common.inc.php)

Warning 4:

Notice in ./libraries/DatabaseInterface.class.php#2667
Use of undefined constant PMA_DRIZZLE - assumed 'PMA_DRIZZLE'

Backtrace

./libraries/db_common.inc.php#24: PMA_DatabaseInterface->isSystemSchema(string '')
./db_structure.php#14: require_once(./libraries/db_common.inc.php)

Warning 5:

Notice in ./libraries/DatabaseInterface.class.php#2668
Use of undefined constant PMA_DRIZZLE - assumed 'PMA_DRIZZLE'

Backtrace

./libraries/db_common.inc.php#24: PMA_DatabaseInterface->isSystemSchema(string '')
./db_structure.php#14: require_once(./libraries/db_common.inc.php)

Ignoring these and attempting to login anyway, I get the following:

Error on Login Attempt:

#2002 - No such file or directory<br />The server is not responding (or the local server's socket is not correctly configured).

Is what I'm trying to do even possible, or is it an absolute requirement that phpmyadmin have a local database in order to function, even though the database I want to access is on a remote machine?

2
задан 27 October 2016 в 04:24
1 ответ

Убедитесь, что вы запустили файл SQL базы данных phpmyadmin на удаленном хосте:

-- --------------------------------------------------------
-- SQL Commands to set up the pmadb as described in the documentation.
--
-- This file is meant for use with MySQL 5 and above!
--
-- This script expects the user pma to already be existing. If we would put a
-- line here to create him too many users might just use this script and end
-- up with having the same password for the controluser.
--
-- This user "pma" must be defined in config.inc.php (controluser/controlpass)
--
-- Please don't forget to set up the tablenames in config.inc.php
--

-- --------------------------------------------------------
[...]

Просмотреть весь файл: https://github.com/phpmyadmin/phpmyadmin/blob/master/ sql / create_tables.sql

0
ответ дан 3 December 2019 в 14:20

Теги

Похожие вопросы