New plugin adminer to manage your database

New plugin adminer to manage your database

by Andreas Grabs -
Number of replies: 19
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators

Hi,

I want to introduce a new plugin "adminer".
This plugin is based on the great tool adminer.
The main advantage of this plugin is, it can handle different databases. So it works with MySQL, PostgreSQL, Oracle and MSSQL.
Here you can download it.

Feel free to test it.
To install you only have to copy it into the "local" folder in your moodle-installation and running the notification-page.
After the installation you will find a new link "Moodle Adminer" below "Site administration -> Server".

Note: this plugin only runs on Moodle 2.0, 2.1 and 2.2

Best regards
Andreas

Attachment adminer.jpg
Average of ratings: Useful (2)
In reply to Andreas Grabs

Re: New plugin adminer to manage your database

by Stuart Mealor -

Interesting work Andreas - thanks !

I use phpMyAdmin quite often.
I was interested looking at the "adminer" website where it compares itself to phpMyAdmin it says:

  • Tidier user interface (OK, it probably is better)
  • Better support for MySQL features (really?)
  • Higher performance (in what way?)
  • More security (I don't know enough to evaluate this, but would this make any difference when doing simple Moodle database work?)

I guess what I am asking those with greater DB experience than myself is: Are there are clear advantages to using adminer over phpMyAdmin when dealing with Moodle ?

In reply to Stuart Mealor

Re: New plugin adminer to manage your database

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators
Hi,

there are a lot of things.
Here are some of them (not possible with phpMyAdmin):
1) you can define trigger
2) you can change the order of fields
3) you can easy create or alter views
4) you can create stored procedures
5) if you rename a database so the database is altered and not copied like phpMyAdmin it does
6) you can define foreign key with referential integrity

Adminer can work with different types of databases like PostgreSQL, Oracle or MSSQL.
This moodle-plugin connect automaticaly to the currently used moodle database.

Best regards
Andreas
Average of ratings: Useful (1)
In reply to Andreas Grabs

Re: New plugin adminer to manage your database

by Stuart Mealor -

Thanks Andreas smile

I tend to use phpMyAdmin through Webmin, so some of that functionality seems to exist (e.g views).

The renaming functionality sounds quite different though - so I'll look into that.

Thanks - Stu.

In reply to Andreas Grabs

Re: New plugin adminer to manage your database

by Valter Lelli -

Hi Andreas,

I installed webminer on moodle 2.8 MySQL: 5.5.40-0 ubuntu0.14.04.1  PHP MySQLi

All works perfectly on moodle DB.

I would like to create another DB for a Q&A sw  but the  authenticated moodle user  hasn't privilegies for this.

Is there a way to modify adminer logon user/password  ?

Thanks in advance,


Valter Lelli


Attachment adminer-2015-09-18_100212.jpg
In reply to Andreas Grabs

Re: New plugin adminer to manage your database

by Irfan Ali -

Hi Andreas,

it's very simple to install good job Yes

In reply to Andreas Grabs

Re: New plugin adminer to manage your database

by John Ryan -

 

I installed this on my server and received no errors but get this error message when I select a database;

Fatal error: session_start() [<a href='function.session-start'>function.session-start</a>]: Failed to initialize storage module: user (path: /var/lib/php/session) in /var/www/html/moodle2/moodle/local/adminer/lib/adminer-3.3.3.php on line 183


The server is runnning moodle 2.0.7 and apache 2, mysql 5.0.77 php 5.2.10


In reply to John Ryan

Re: New plugin adminer to manage your database

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators
Hi John,

I can not say what is wrong there. Please check the permissions of your session folder. Is there space enough.
This plugin uses the moodle session settings so all should be ok.
I tested with and without db-session.

Andreas
In reply to Andreas Grabs

Re: New plugin adminer to manage your database

by John Ryan -

I did have it set to use the database for sessions.  I have now turned it off and it adminer now works.

Thanks for the quick response.

In reply to Andreas Grabs

Re: New plugin adminer to manage your database

by Luis de Vasconcelos -

Andreas,

Thanks for this adminer plugin - it was a great discovery!

However, does it work with Moodle sites that run on MSSQL 2008 R2 databases? The "modern" way to connect to MSSQL databases is to use the Microsoft Drivers for PHP for SQL Server. To use that driver you use $CFG->dbtype = 'sqlsrv'; in the Moodle config.php file - not the old PHP MSSQL driver ('mssql') or the FreeTDS driver ('mssql_n'). Looking at the code in \local\adminer\index.php there only seems to be support for the old 'mssql' driver:

switch ($CFG->dbtype) {
    case 'pgsql':
        $adminer_driver = 'pgsql';
        break;
    case 'mssql':
        $adminer_driver = 'mssql';
        break;
    case 'oci':
        $adminer_driver = 'oracle';
        break;
    default:
        $adminer_driver = 'server'; //this is for mysql
        break;
}

So, can you confirm if Adminer is compatible with MSSQL 2008 R2 (via the Microsoft Drivers for PHP for SQL Server)?

In reply to Luis de Vasconcelos

Re: New plugin adminer to manage your database

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators
Hi Luis,

I can't promise that but it seems to be a driver for "sqlsrv" in it.
Could you try the index.php attached here? If it works so I will include this.

Best regards
Andreas
Average of ratings: Useful (1)
In reply to Luis de Vasconcelos

Re: New plugin adminer to manage your database

by Luis de Vasconcelos -

Thanks. I tried your index.php file and I now get a blank Login screen with no further actions:

adminer screenshot

What am I supposed to see?

"View Source" is attached.

In reply to Luis de Vasconcelos

Re: New plugin adminer to manage your database

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators
Hi Luis,

it seems there is only one mssql-driver in adminer. But it uses both, mssql and sqlsrv. At first it tries to load the sqlsrv-extension. So now it could work for you.
I have attached another try.
Could you please check this too?

Best regards
Andreas
In reply to Andreas Grabs

Re: New plugin adminer to manage your database

by Luis de Vasconcelos -

Thanks. It works now! I see this:

Adminer - alive and well...

This did the trick:

    case 'sqlsrv':
    case 'mssql':
        $adminer_driver = 'mssql';
        break;

 

In reply to Luis de Vasconcelos

Re: New plugin adminer to manage your database

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators
Hi Luis,

sorry for long waiting of a response.
Now the change is included into the current download.

Best regards
Andreas
In reply to Andreas Grabs

Re: New plugin adminer to manage your database

by Thelma Polanco-Perez -

Hi Andreas,

I installed the plugin with the latest index.php you attached here, but I'm still getting a blank login screen.

I'm running moodle 2.5.1, php 5.3.3 and postgres 8.4.9.

Any ideas? smile

Attachment adminer_login.jpg
In reply to Thelma Polanco-Perez

Re: New plugin adminer to manage your database

by Ian Tasker -

Are you running your database on a custom port?

Adminer ignores the port if it has been defined as  $CFG->dboptions['port'] = '1234' in config.php, it expects $CFG->dbhost to contain the server and port.

I have submitted a patch to the developer which resolves this. 

In reply to Ian Tasker

Re: New plugin adminer to manage your database

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators

Hi Ian,

thanks! There is a new version now.

Best regards
Andreas

In reply to Andreas Grabs

Re: New plugin adminer to manage your database

by Séverin Terrier -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Hi Andrea,

Thanks for this nice and useful plugin smile

I just wanted to say that it also work with Moodle 2.3. Would be good to put this information on plugin's page wink

Séverin

In reply to Séverin Terrier

Re: New plugin adminer to manage your database

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators
Hi Séverin,

thank you for this information!
Now it appears as compatible with 2.3.

Best regards
Andreas