Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-12-2010, 05:34 PM   PM User | #1
Gremlyn1
New Coder

 
Join Date: Apr 2009
Location: San Diego, CA
Posts: 64
Thanks: 2
Thanked 1 Time in 1 Post
Gremlyn1 is an unknown quantity at this point
[Solved] phpMyAdmin Help - no dropdown for multiple servers

So I'm not sure this is int he right place, so please move it and correct me if I'm wrong.

I'm trying to set up my phpMyAdmin to allow me to access a remote server. I had this set up before and working perfectly, but I am on a vbox Ubuntu guest that I screwed up and had to reinstall and now can't get it working.

My config file looks like this:
PHP Code:
<?php
/**
 * Server(s) configuration
 */
$i 0;
// The $cfg['Servers'] array starts with $cfg['Servers'][1].  Do not use $cfg['Servers'][0].
// You can disable a server config entry by setting host to ''.
$i++;

/**
 * Read configuration from dbconfig-common
 * You can regenerate it using: dpkg-reconfigure -plow phpmyadmin
 */
if (is_readable('/etc/phpmyadmin/config-db.php')) {
    require(
'/etc/phpmyadmin/config-db.php');
}

/* Configure according to dbconfig-common if enabled */
if (!empty($dbname)) {
    
/* Authentication type */
    
$cfg['Servers'][$i]['auth_type'] = 'cookie';
    
/* Server parameters */
    
if (empty($dbserver)) $dbserver 'localhost';
    
$cfg['Servers'][$i]['host'] = $dbserver;
    if (!empty(
$dbport)) {
        
$cfg['Servers'][$i]['connect_type'] = 'tcp';
        
$cfg['Servers'][$i]['port'] = $dbport;
    }
    
//$cfg['Servers'][$i]['compress'] = false;
    /* Select mysqli if your server has it */
    
$cfg['Servers'][$i]['extension'] = 'mysqli';
    
/* Optional: User for advanced features */
    
$cfg['Servers'][$i]['controluser'] = $dbuser;
    
$cfg['Servers'][$i]['controlpass'] = $dbpass;
    
/* Optional: Advanced phpMyAdmin features */
    
$cfg['Servers'][$i]['pmadb'] = $dbname;
    
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
    
$cfg['Servers'][$i]['relation'] = 'pma_relation';
    
$cfg['Servers'][$i]['table_info'] = 'pma_table_info';
    
$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
    
$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
    
$cfg['Servers'][$i]['column_info'] = 'pma_column_info';
    
$cfg['Servers'][$i]['history'] = 'pma_history';
    
$cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';

    
/* Uncomment the following to enable logging in to passwordless accounts,
     * after taking note of the associated security risks. */
    // $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;

    /* Advance to next server for rest of config */
    
$i++;
    
$cfg['Servers'][$i]['host']          = '12.34.56.789';
    
$cfg['Servers'][$i]['port']          = '';          // MySQL port - leave blank for default port
    
$cfg['Servers'][$i]['socket']        = '';          // Path to the socket - leave blank for default socket
    
$cfg['Servers'][$i]['connect_type']  = 'tcp';       // How to connect to MySQL server ('tcp' or 'socket')
    
$cfg['Servers'][$i]['extension']     = 'mysql';     // The php MySQL extension to use ('mysql' or 'mysqli')
    
$cfg['Servers'][$i]['compress']      = FALSE;       // Use compressed protocol for the MySQL connection (requires PHP >= 4.3.0)
    
$cfg['Servers'][$i]['auth_type']     = 'config';
    
$cfg['Servers'][$i]['user']          = 'myusername';
    
$cfg['Servers'][$i]['password']      = 'mypassword';
}

/*
 * End of servers configuration
 */

/*
 * Directories for saving/loading files from server
 */
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';

$cfg['blowfish_secret'] = 'MyHashIsHere';
I don't get the little drop down box on the log-in page like I did last time I set this up, and I see no other way to try to access the remote server. I found something that said I should set $cfg['ServerDefault'] = 0 but doing so took me to a page resembling a logged session of phpMyAdmin without any databases or options to do anything...

Ideas?

Last edited by Gremlyn1; 07-12-2010 at 07:29 PM..
Gremlyn1 is offline   Reply With Quote
Old 07-12-2010, 07:29 PM   PM User | #2
Gremlyn1
New Coder

 
Join Date: Apr 2009
Location: San Diego, CA
Posts: 64
Thanks: 2
Thanked 1 Time in 1 Post
Gremlyn1 is an unknown quantity at this point
OK, a whole bunch of trial and error got it to work. The check for if (!empty($dbname)) was screwing it up apparently. This is what I ended up with:

PHP Code:
<?php
/**
 * Server(s) configuration
 */
$i 0;
// The $cfg['Servers'] array starts with $cfg['Servers'][1].  Do not use $cfg['Servers'][0].
// You can disable a server config entry by setting host to ''.
$i++;

/**
 * Read configuration from dbconfig-common
 * You can regenerate it using: dpkg-reconfigure -plow phpmyadmin
 */
if (is_readable('/etc/phpmyadmin/config-db.php')) {
    require(
'/etc/phpmyadmin/config-db.php');
}

/* Configure according to dbconfig-common if enabled */
/* localhost server setup - main server */
$cfg['Servers'][$i]['host']          = 'localhost';
$cfg['Servers'][$i]['port']          = '';          // MySQL port - leave blank for default port
$cfg['Servers'][$i]['socket']        = '';          // Path to the socket - leave blank for default socket
$cfg['Servers'][$i]['connect_type']  = 'tcp';       // How to connect to MySQL server ('tcp' or 'socket')
$cfg['Servers'][$i]['extension']     = 'mysqli';    // The php MySQL extension to use ('mysql' or 'mysqli')
$cfg['Servers'][$i]['compress']      = FALSE;       // Use compressed protocol for the MySQL connection (requires PHP >= 4.3.0)
$cfg['Servers'][$i]['auth_type']     = 'cookie';

/* Advance to next server for rest of config */
$i++;
$cfg['Servers'][$i]['host']          = '12.34.56.789';
$cfg['Servers'][$i]['port']          = '';          // MySQL port - leave blank for default port
$cfg['Servers'][$i]['socket']        = '';          // Path to the socket - leave blank for default socket
$cfg['Servers'][$i]['connect_type']  = 'tcp';       // How to connect to MySQL server ('tcp' or 'socket')
$cfg['Servers'][$i]['extension']     = 'mysql';     // The php MySQL extension to use ('mysql' or 'mysqli')
$cfg['Servers'][$i]['compress']      = FALSE;       // Use compressed protocol for the MySQL connection (requires PHP >= 4.3.0)
$cfg['Servers'][$i]['auth_type']     = 'config';
$cfg['Servers'][$i]['user']          = 'myusername';
$cfg['Servers'][$i]['password']      = 'mypassword'

/*
 * End of servers configuration
 */

/*
 * Directories for saving/loading files from server
 */
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';

$cfg['blowfish_secret'] = 'MyHashIsHere';
Gremlyn1 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:57 PM.


Advertisement
Log in to turn off these ads.