Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Database Server
  • Search

[FIX] phpmyadmin some feature/controluser

Questions regarding the Database Server
MySQL, PostgreSQL, MariaDB, Percona Server, phpMyAdmin, phpPgAdmin
Post Reply
  • Print view
Advanced search
87 posts
  • Page 2 of 9
    • Jump to page:
  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • …
  • 9
  • Next
jonn
Posts: 72
Joined: Sun Jun 08, 2014 12:18 pm

Re: [FIX] phpmyadmin some feature/controluser
  • Quote

Post by jonn » Sun Jan 31, 2016 4:20 am

@ skurudo

on the debian 7, the wrong repo was used so that is what messed up the phpmyadmin I had 4 open windows I messed that myself after checking your suggestions, never the less, woopsy daisy.. I settled on Debian 8, and yes I would like this phpmyadmin fix.
Anyway, to improve script, if you cooperate, I'll help and can check this situation with you or on your server - your choice.
Absolutely, Im on Australian time so whats good for you.. I can just email you ip details if that works...

I will need the new file manager on one server do you guys install or do I after purchase?
Top

neiklot
Posts: 13
Joined: Tue Jan 19, 2016 9:56 am

Re: [FIX] phpmyadmin some feature/controluser
  • Quote

Post by neiklot » Sun Jan 31, 2016 4:43 pm

Hi! I'm trying to run this script in debian 8 jessie and it returns error:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

I changed my root and mysql password but I think i set it up in the vestacp config files inside /usr/local/vesta/conf/*

Any suggestion?

EDIT: Solved, I hadn't saved my new password properly in this file: /root/.my.cnf
Top

jonn
Posts: 72
Joined: Sun Jun 08, 2014 12:18 pm

Re: [FIX] phpmyadmin some feature/controluser
  • Quote

Post by jonn » Mon Feb 01, 2016 11:44 pm

I also have two Debian 8 masters but I haven't applied this patch yet.
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: [FIX] phpmyadmin some feature/controluser
  • Quote

Post by skurudo » Tue Feb 02, 2016 6:52 am

Well, I tested one again and all good, nothing strange or bugs.
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: [FIX] phpmyadmin some feature/controluser
  • Quote

Post by skurudo » Tue Feb 02, 2016 6:55 am

jonn wrote:@ skurudo
I will need the new file manager on one server do you guys install or do I after purchase?
This option will show automatically, when you add license key.

PS: I'll pm you about fix, let's exprore bug on your server.
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: [FIX] phpmyadmin some feature/controluser
  • Quote

Post by skurudo » Wed Feb 03, 2016 9:11 am

neiklot wrote: EDIT: Solved, I hadn't saved my new password properly in this file: /root/.my.cnf
You're right, root password in .my.cnf it's critical thing - or we should ask user about root password, or parse from mysql.conf... It's not universal way, I think.
Top

jonn
Posts: 72
Joined: Sun Jun 08, 2014 12:18 pm

Re: [FIX] phpmyadmin some feature/controluser
  • Quote

Post by jonn » Sun Feb 07, 2016 11:07 pm

I just run a test on centos 7 default install just to see what the difference was and ran the fixer after installing vestacp.
@skurudo The double localhost issue that we saw on debian 8 doesnt happen on centos 7, the only issue with centos 7 is after the fixer;

- logging in with root.-- no issue no error shown, clean.

- logging as admin_default db user.

Code: Select all

 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.
click the link Find out Why.

Code: Select all

Configuration of pmadb… not OKDocumentation
General relation features Disabled
Top

jonn
Posts: 72
Joined: Sun Jun 08, 2014 12:18 pm

Re: [FIX] phpmyadmin some feature/controluser
  • Quote

Post by jonn » Mon Feb 08, 2016 1:59 am

Okay I fixed the problem with centos 7 x64, php5.6, phpMyAdmin 4.5.4.1, mariaDB 5.5.44. I moved the configs up as follow in /etc/phpMyAdmin/config.inc.php

I also added $cfg['Servers'][$i]['hide_db'] = 'information_schema'; to hide it from users.
This is a working copy modification after running the fixer installer

Code: Select all

<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * phpMyAdmin sample configuration, you can use it as base for
 * manual configuration. For easier setup you can use setup/
 *
 * All directives are explained in Documentation.html and on phpMyAdmin
 * wiki <http://wiki.phpmyadmin.net>.
 *
 * @package phpMyAdmin
 */

/*
 * This is needed for cookie based authentication to encrypt password in
 * cookie
 */
$cfg['blowfish_secret'] = 'D32d234L1'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

/*
 * Servers configuration
 */
$i = 0;

/*
 * First server
 */
$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';
$cfg['Servers'][$i]['AllowNoPassword'] = false;

/*
 * phpMyAdmin configuration storage settings.
 */

$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = 'a7skbhfr3ui4hhriu34nifn32nn32rZQBaC'; // CHANGE your own controlpass

/* User used to manipulate with storage */
$cfg['Servers'][$i]['hide_db'] = 'information_schema';

$cfg['Servers'][$i]['favorite'] = 'pma__favorite';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';


/* Storage database and tables */



/* Contrib / Swekey authentication */
// $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';

/*
 * End of servers configuration
 */

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

/**
 * Defines whether a user should be displayed a "show all (records)"
 * button in browse mode or not.
 * default = false
 */
//$cfg['ShowAll'] = true;

/**
 * Number of rows displayed when browsing a result set. If the result
 * set contains more rows, "Previous" and "Next".
 * default = 30
 */
//$cfg['MaxRows'] = 50;

/**
 * Use graphically less intense menu tabs
 * default = false
 */
//$cfg['LightTabs'] = true;

/**
 * disallow editing of binary fields
 * valid values are:
 *   false  allow editing
 *   'blob' allow editing except for BLOB fields
 *   'all'  disallow editing
 * default = blob
 */
//$cfg['ProtectBinary'] = 'false';

/**
 * Default language to use, if not browser-defined or user-defined
 * (you find all languages in the locale folder)
 * uncomment the desired line:
 * default = 'en'
 */
//$cfg['DefaultLang'] = 'en';
//$cfg['DefaultLang'] = 'de';

/**
 * default display direction (horizontal|vertical|horizontalflipped)
 */
//$cfg['DefaultDisplay'] = 'vertical';


/**
 * How many columns should be used for table display of a database?
 * (a value larger than 1 results in some information being hidden)
 * default = 1
 */
//$cfg['PropertiesNumColumns'] = 2;

/**
 *
 * This requires configuration storage enabled, see above.
 * default = false
 */
//$cfg['QueryHistoryDB'] = true;

/**
 *
 * default = 25
 */
//$cfg['QueryHistoryMax'] = 100;

/*
 * You can find more configuration options in Documentation.html
 * or here: http://wiki.phpmyadmin.net/pma/Config
 */
?>


seems to work fine, created tests dbs and they seem to work okay without any notices, seems clean.
Top

jonn
Posts: 72
Joined: Sun Jun 08, 2014 12:18 pm

Re: [FIX] phpmyadmin some feature/controluser
  • Quote

Post by jonn » Mon Feb 08, 2016 2:31 am

Okay fixed Debian 8 x64, php5.6, mysql 5.5.47, phpmyadmin 4.2.12, moved configs up as follows in /etc/phpmyadmin/config.inc.php

I also added $cfg['Servers'][$i]['hide_db'] = 'information_schema'; to hide it from users.
This is a working copy modification after running the fixer installer.

Code: Select all

<?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).
 */

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 */
    /* Optional: Advanced phpMyAdmin features */

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

    $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
    $cfg['Servers'][$i]['controluser'] = 'pma';
    $cfg['Servers'][$i]['controlpass'] = 'sbwtw35cfv345e4wv6we6twv6345t3tvh'; // change to your own controlpass

    $cfg['Servers'][$i]['hide_db'] = 'information_schema';

    $cfg['Servers'][$i]['favorite'] = 'pma__favorite';
    $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
    $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
    $cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
    $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
    $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
    $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
    $cfg['Servers'][$i]['users'] = 'pma__users';
    $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
    $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
    $cfg['Servers'][$i]['relation'] = 'pma__relation';
    $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
    $cfg['Servers'][$i]['table_info'] = 'pma__table_info';
    $cfg['Servers'][$i]['column_info'] = 'pma__column_info';
    $cfg['Servers'][$i]['history'] = 'pma__history';
    $cfg['Servers'][$i]['recent'] = 'pma__recent';
    $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
    $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
    $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
    $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
    $cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';
    $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 */

/* Storage database and tables */
/* 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);
}

?>

Tested couple of db's seems to work, clean, no notices.
Top

jonn
Posts: 72
Joined: Sun Jun 08, 2014 12:18 pm

Re: [FIX] phpmyadmin some feature/controluser
  • Quote

Post by jonn » Mon Feb 08, 2016 3:53 am

Secure phpmyadmin and Disable root login

Code: Select all

$cfg['Servers'][$i]['AllowRoot'] = FALSE;
Top


Post Reply
  • Print view

87 posts
  • Page 2 of 9
    • Jump to page:
  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • …
  • 9
  • Next

Return to “Database Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password