NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

michelefaccini's avatar
Sep 28, 2014

PhpMyAdmin Bundle (R4x86)

Hi all,

I've just bought this bundle to upgrade my PHP and phpMyAdmin installation on my ReadyNas Ultra 2 Plus.

Because I didn't want to edit manually the conf.inc.php file to set up phpMyAdmin, I accessed the automatic setup script from the browser (with https://192.168.0.2/phpmyadmin/setup/index.php).After I set up my configuration, a new config.inc.php file should have been saved in the config folder (folder that I created manually under usr/share/phpmyadmin) but the folder is empty !

I discovered that under etc/phpmyadmin there is a config.inc.php file which overrides the settings made by phpMyAdmin interactive setup
utility.

<?php
/**
* Debian local configuration file
*
* This file overrides the settings made by phpMyAdmin interactive setup
* utility.
*
* For example configuration see
* /usr/share/doc/phpmyadmin/examples/config.sample.inc.php
* or
* /usr/share/doc/phpmyadmin/examples/config.manyhosts.inc.php
*
* NOTE: do not add security sensitive data to this file (like passwords)
* unless you really know what you're doing. If you do, any user that can
* run PHP or CGI on your webserver will be able to read them. If you still
* want to do this, make sure to properly secure the access to this file
* (also on the filesystem level).
*/

if (!function_exists('check_file_access')) {
function check_file_access($path)
{
if (is_readable($path)) {
return true;
} else {
error_log(
'phpmyadmin: Failed to load ' . $path
. ' Check group www-data has read access and open_basedir restrictions.'
);
return false;
}
}
}

// Load secret generated on postinst
if (check_file_access('/var/lib/phpmyadmin/blowfish_secret.inc.php')) {
require('/var/lib/phpmyadmin/blowfish_secret.inc.php');
}

// Load autoconf local config
if (check_file_access('/var/lib/phpmyadmin/config.inc.php')) {
require('/var/lib/phpmyadmin/config.inc.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 (check_file_access('/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) || $dbserver != 'localhost') {
$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]['table_uiprefs'] = 'pma_table_uiprefs';
$cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
$cfg['Servers'][$i]['tracking'] = 'pma_tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
$cfg['Servers'][$i]['recent'] = 'pma_recent';

/* 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++;
}

/* Authentication type */
//$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
//$cfg['Servers'][$i]['host'] = 'localhost';
//$cfg['Servers'][$i]['connect_type'] = 'tcp';
//$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
//$cfg['Servers'][$i]['extension'] = 'mysql';
/* Optional: User for advanced features */
// $cfg['Servers'][$i]['controluser'] = 'pma';
// $cfg['Servers'][$i]['controlpass'] = 'pmapass';

/* Storage database and tables */
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
// $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]['table_uiprefs'] = 'pma_table_uiprefs';
// $cfg['Servers'][$i]['tracking'] = 'pma_tracking';
// $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
// $cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
// $cfg['Servers'][$i]['recent'] = 'pma_recent';
/* Uncomment the following to enable logging in to passwordless accounts,
* after taking note of the associated security risks. */
// $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;

/*
* End of servers configuration
*/

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

/* Support additional configurations */
foreach (glob('/etc/phpmyadmin/conf.d/*.php') as $filename)
{
include($filename);
}



So If I'm not wrong the only way to configure phpMyadmin is to create manually a config.inc.php file which has to be saved under conf.d folder (which is under etc/phpmyadmin).
Is it right...or am I missing something ?
Thanks for any answer......

6 Replies

Replies have been turned off for this discussion
  • michelefaccini wrote:
    Because I didn't want to edit manually the conf.inc.php file to set up phpMyAdmin, I accessed the automatic setup script from the browser (with https://192.168.0.2/phpmyadmin/setup/index.php).After I set up my configuration, a new config.inc.php file should have been saved in the config folder (folder that I created manually under usr/share/phpmyadmin) but the folder is empty !

    Did you press the "Save" button twice? You have to press it once when saving the current MySQL Server config and the second time to save the complete config back to a file. Also, did you set the access permissions correctly in the PhpMyAdmin config pane within Frontview before getting to the configuration?

    What made you think you would need to create a directory manually and why do you think you got the correct location and where should PhpMyAdmin know from that you created the directory and that it should save your settings there? In reality, the config is saved to the /var/lib/phpmyadmin directory - but again, only if you really saved
    it.

    michelefaccini wrote:
    So If I'm not wrong the only way to configure phpMyadmin is to create manually a config.inc.php file which has to be saved under conf.d folder (which is under etc/phpmyadmin).
    Is it right...or am I missing something ?

    I'd say you're missing something.

    -Stefan
  • What I did :
    1/ I installed the add-ons (without uninstalling the previous php and phpMyAdmin addons).
    2/ I accessed the Frontview and set the Protection up to open (I also tried to Admin only) in the pane.
    3/ I clicked on 'Configure PhpMyAdmin'.
    4/ I chose 'new server' and set it up.
    5/ I chose 'save' and got the following message :
    Configuration saved.
    Configuration saved to file config/config.inc.php in phpMyAdmin top level directory, copy it to top level one and delete directory config to use it.

    That's why I thought I had to create the config folder by myself....there wasn't any....

    Actual situation : I can access phpMyAdmin with https://192.168.0.2/phpmyadmin/index.php,I can see that my databases are listed but when I choose to click something on the page nothing happens.
    My website is functioning....so the server and my databases are ok but the phpMyAdmin interface is not communicating
  • Can you try opening the debug mode of your browser (like for example "Inspect Element" in Chrome/Firefox) and see what errors - if any - are displayed? Or try to use a different browser? PhpMyAdmin works for me on three different browsers with multiple database servers from my Mac but since it doesn't do anything for you I suspect it's either a browser problem or a problem of the web interface communicating with the PhpMyAdmin backend on the ReadyNAS.

    -Stefan
  • WhoCares...you're a magician...Thanks.
    I tried with Chrome and got an error saying it was not a private connection so I changed from https://192.168.0.2/phpmyadmin/index.php to http://192.168.0.2/phpmyadmin/index.php.....ET VOILA'.

    Now I'm trying to connect MySQL Workbench 6.1 CE to my Nas....

    I read the following post http://www.readynas.com/forum/viewtopic.php?f=34&t=49824.
    In my.cnf skip-networking is already commented out.

    I'm trying for the connection method : Local Socket/Pipe...
    I have to figure out what to fill in for the Socket/Pipe Path !

    A piece of that path should be /var/run/mysqld/mysqld.sock...is it right ?
  • Your problem is that by default the MySQL server on the ReadyNAS only listens on the 127.0.0.1 (localhost) interface. Or in other words: it doesn't listen on the external interfaces that are used to attach your ReadyNAS to your local network. Thus you need to change the MySQL configuration before you can use MySQL Workbench or similar tools. To change MySQL's behavior, use an SSH shell and edit the file /etc/mysql/my.cnf. Look for this line:

    bind-address = 127.0.0.1

    and change it to

    bind-address = 0.0.0.0

    Then restart the MySQL server. The easiest way for stopping/starting MySQL would be to use the MySQLOn add-on.

    -Stefan

NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology! 

Join Us!

ProSupport for Business

Comprehensive support plans for maximum network uptime and business peace of mind.

 

Learn More