Page 1 of 9

[FIX] phpmyadmin some feature/controluser

Posted: Fri Jan 15, 2016 8:05 pm
by skurudo
Fixes for phpmyadmin (configuration storage and some extended features)

If you're tired of the message "The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated", this patch for you ;-)

What do you get?
- Tracking pages (version control MySQL table structure and data);
- Bookmarks allow you to save predefined queries and execute them later;
- You can show recently used tables in the navigation panel. It helps you jump across the table directly, without the need to select the database and the table;
- Triggers - code which is automatically executed in response to certain events.
- Designer mode (visually display your tables and a graphical way of creating, editing, and displaying phpMyAdmin relations);
- Relation support (allows relationships (similar to foreign keys) using MySQL-native (InnoDB) methods);
- PDF schema (phpMyAdmin can produce PDF schema of your database);
- You can store comments to describe each column for each table. These will then be shown on the “printview”;
- phpMyAdmin can be configured to remember several things, column order, and column visibility from a database table) for browsing tables;
- Since release 3.4.x phpMyAdmin allows users to set most preferences by themselves and store them in the database;
- Since release 4.2.0 you can save and load query-by-example searches from the Database > Query panel;
- Since release 4.5.0 you can save and load export templates;
- no message about "storage is not completely configured";

_(information source - phpMyAdmin FAQ page)_

Installation:
Universal installer with OS Checker

Code: Select all

curl -O -k https://raw.githubusercontent.com/skurudo/phpmyadmin-fixer/master/pma.sh && chmod +x pma.sh && ./pma.sh
or

Code: Select all

sudo wget --no-check-certificate https://raw.githubusercontent.com/skurudo/phpmyadmin-fixer/master/pma.sh && chmod +x pma.sh && ./pma.sh
OS Installation:
Ubuntu

Code: Select all

curl -O -k https://raw.githubusercontent.com/skurudo/phpmyadmin-fixer/master/pma-ubuntu.sh && chmod +x pma-ubuntu.sh && ./pma-ubuntu.sh
or

Code: Select all

sudo wget --no-check-certificate https://raw.githubusercontent.com/skurudo/phpmyadmin-fixer/master/pma-ubuntu.sh && sudo chmod +x pma-ubuntu.sh && sudo ./pma-ubuntu.sh
Debian

Code: Select all

curl -O -k https://raw.githubusercontent.com/skurudo/phpmyadmin-fixer/master/pma-debian.sh && chmod +x pma-debian.sh && ./pma-debian.sh
or

Code: Select all

wget --no-check-certificate https://raw.githubusercontent.com/skurudo/phpmyadmin-fixer/master/pma-debian.sh && chmod +x pma-debian.sh && ./pma-debian.sh
CentOS

Code: Select all

curl -O -k https://raw.githubusercontent.com/skurudo/phpmyadmin-fixer/master/pma-centos.sh && chmod +x pma-centos.sh && ./pma-centos.sh
or

Code: Select all

wget --no-check-certificate https://raw.githubusercontent.com/skurudo/phpmyadmin-fixer/master/pma-centos.sh && chmod +x pma-centos.sh && ./pma-centos.sh
What the script does:
- we don't use pwgen for generation password anymore, no extra utilities;
- check wget/curl before downloading dump for database;
- universal installer with os detector by Sergey Rodin (VestaCP - https://vestacp.com);
- options savedsearches / navigationhiding / users / usergroups are set (for 4.x phpmyadmin);
- added table pma__usergroups (for 4.x phpmyadmin);
- sql dump on github now;
- sh files on github too.

Tested on different servers: Debian 7/8, Ubuntu 12/14/15, CentOS 6/7

Support 3.x and 4.x version of phpmyadmin

Re: [FIX] phpmyadmin some feature/controluser

Posted: Sat Jan 16, 2016 1:06 am
by BBuchanan1013
Ok, tested on CentOS 7. Here's my results:

1. It works 98%
2. My only complaint after looking through it, is that it grants all global privileges so should someone find a way to access pma, they'd have access to all the databases.

3. The 98% is because it doesn't delete the pma.txt file at the end, instead giving:

Code: Select all

rm: cannot remove 'pma.txt' : no such file or directory
Where ever you run the commands from will produce some files:
config.inc.php.old
pma-centos.sh
pma.txt

So, if possible, have it build/make/run from a temp directory then remove the directory to remove the temp files. My suggestion. Otherwise,

It worked great.

Re: [FIX] phpmyadmin some feature/controluser

Posted: Sun Jan 17, 2016 9:58 am
by skurudo
BBuchanan1013 wrote:Ok, tested on CentOS 7. Here's my results:
2. My only complaint after looking through it, is that it grants all global privileges so should someone find a way to access pma, they'd have access to all the databases.
Yeah, it's kinda too much - fixed - only to phpmyadmin table.

Code: Select all

GRANT USAGE ON $PMADB.* TO '$PMAUSER'@'localhost' IDENTIFIED BY '$PASS';
GRANT ALL PRIVILEGES ON $PMADB.* TO '$PMAUSER'@'localhost';
BBuchanan1013 wrote: 3. The 98% is because it doesn't delete the pma.txt file at the end, instead giving:

Code: Select all

rm: cannot remove 'pma.txt' : no such file or directory
Fixed too, it's from old code, idea was: if you launch script one or two time, then you can have fresh password for pma user.
BBuchanan1013 wrote: Where ever you run the commands from will produce some files:
config.inc.php.old
pma-centos.sh
pma.txt
I think about it, alpha-beta now - let's pretend this is files for bug-trace. If all test will be good, then we can not produce - config.inc.php.old and pma.txt.

Re: [FIX] phpmyadmin some feature/controluser

Posted: Sun Jan 17, 2016 10:46 am
by BBuchanan1013
Just ran on a test build of ubuntu 14.04, fresh install of everything:
http://prntscr.com/9r65sl

However, it was successful with the database. Phpmyadmin db exists, and pma is only using restricted permissions.

Well done.

Re: [FIX] phpmyadmin some feature/controluser

Posted: Sun Jan 17, 2016 11:31 am
by skurudo
BBuchanan1013 wrote: However, it was successful with the database. Phpmyadmin db exists, and pma is only using restricted permissions.
Well done.
Thanks for suggestions ;-)

Re: [FIX] phpmyadmin some feature/controluser

Posted: Sun Jan 17, 2016 6:07 pm
by skurudo
A little update for phpmyadmin 4.x:
- options savedsearches / navigationhiding / users / usergroups are set (this don't need in old phpmyadmin like 3.4)
- added table pma__usergroups

Re: [FIX] phpmyadmin some feature/controluser

Posted: Mon Jan 18, 2016 4:43 am
by skurudo
Moved files on github for stability and other good. I think it's no more alpha, it's beta ;-)

Re: [FIX] phpmyadmin some feature/controluser

Posted: Sun Jan 24, 2016 9:45 am
by erm3nda
Thank you so much, worked great.

Re: [FIX] phpmyadmin some feature/controluser

Posted: Sat Jan 30, 2016 7:10 am
by jonn
this didnt work for me, broke one of my debian 7 php5.6 installs phpmyadmin now shows not found error, looks like it modified some files and messed it up.

And on one default debian 7 install with php5.4 server I installed this and it didnt change..
The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. To find out why click here.

Re: [FIX] phpmyadmin some feature/controluser

Posted: Sat Jan 30, 2016 11:56 am
by skurudo
jonn wrote:this didnt work for me, broke one of my debian 7 php5.6 installs phpmyadmin now shows not found error, looks like it modified some files and messed it up.
About broken php - it's unlikely, script don't do anything with php version - only config.inc.php of phpMyAdmin and import database. Check your copy of old config - config.inc.php.old in /root folder.
jonn wrote:And on one default debian 7 install with php5.4 server I installed this and it didnt change..
The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. To find out why click here.
And you click and what error you get?

Anyway, to improve script, if you cooperate, I'll help and can check this situation with you or on your server - your choice.