How can I disable the phpMyAdmin login page?

61,023

Solution 1

Yep, you can: set your password in the config file. BUT if you are using this on your domain then I'd strongly recommend you take it off your site altogether!

Use a client to access your database - like mysql workbench or mysql yog or any of the numerous ones out there.

If you MUST use phpmyadmin then why not install it on your local machine and add the details to the config there? It is much safer.

Solution 2

You can disable phpMyAdmin by disabling the module configuration.

sudo a2disconf phpmyadmin.conf
sudo /etc/init.d/apache2 restart

Enable it with

sudo a2enconf phpmyadmin.conf
sudo /etc/init.d/apache2 restart

Solution 3

In your config.inc.php file change:

$cfg['Servers'][$i]['auth_type']    = 'config';  

and add

$cfg['Servers'][$i]['user']         = 'root';  
$cfg['Servers'][$i]['password']     = 'password';

Solution 4

In centos, locate the file in directory /etc/httpd/conf.d/phpmyadmin.conf/ and uncomment these lines to only give access on the local system to phpmyadmin, and leave the users from outside with no access to phpmyadmin

<Directory "/usr/share/phpmyadmin">
  Order Deny,Allow
  Deny from all
  Allow from 127.0.0.1
</Directory>

Hope this be helpfull

Solution 5

Preventing remote login doesn’t stop access to phpmyadmin if you have not stopped it in /etc/phpmyadmin/apache.conf

To turn the access to phpmyadmin OFF in ubuntu 14.04 with apache web server, edit /etc/phpmyadmin/apache.conf

Search for or if you set the Alias /phpmyadmin /usr/share/phpmyadmin in the same file.

Add or Edit following lines: Order Deny, Allow Deny from all

Restart apache2 with sudo service apache2 restart

To turn the access to phpmyadmin ON temporarily, first find out your ip address. Search Google, what is my ip address. Then edit vi /etc/phpmyadmin/apache.conf file. Add this line to the above mentioned Directory tag: Allow from

Restart the apache2 with sudo service apache2 restart

Share:
61,023

Related videos on Youtube

Admin
Author by

Admin

Updated on July 09, 2022

Comments

  • Admin
    Admin almost 2 years

    I use phpmyadmin, and when entering this adress:

     www.mydomain.com/phpmyadmin
    

    a login page appears.

    Is there any way of disabling it, so it doesn't appear/exist?

    Thanks

    • Mahdi.Montgomery
      Mahdi.Montgomery over 13 years
      There are better DBA tools out there. I'm in love with Navicat
  • Admin
    Admin over 13 years
    How do I do the later one. Install it on my local computer and configure it there? How do you mean, what is this method called? Links please...
  • Admin
    Admin over 13 years
    Actually no I don't have any other security... Offcourse I need to be safe, and if removing it will harm me then I wont do it. What about ToonMariner:s answer?
  • Loïc Février
    Loïc Février over 13 years
    You can use XAMPP : sourceforge.net/projects/xampp Then edit the config file and configure host/login/database... be aware that some databases can't be access from an other domain (ie, a database at mydomain.com can only be access from a script in the same domain). Often true for free "host", false if you are paying.
  • casablanca
    casablanca over 13 years
    @Camran: You will need to set up a local server with phpMyAdmin on it. Just search for WAMP / LAMP on Google, there are tons of free servers that come pre-installed with phpMyAdmin.
  • Loïc Février
    Loïc Février over 13 years
    Then don't install it in a public directory. Local machine is a good idea. A client is also a good one. Phpmyadmin is a good tool if you need access from everywhere, even computers where you can't install anyhing / use your own USB key but that's in practice pretty rare.
  • i.am.michiel
    i.am.michiel over 12 years
    That is creating another problem instead of giving a solution.
  • Jared
    Jared over 12 years
    I disagree that it causes a problem. It may not behave as they would like, but it does solve the problem.
  • Asaf Maoz
    Asaf Maoz about 10 years
    $cfg['Servers'][$i]['auth_type'] = 'config'; helped me. tnx
  • Dmitry
    Dmitry over 8 years
    If somebody struggles to locate a config file on Ubuntu it's /etc/phpmyadmin/config.inc.php
  • KawaiKx
    KawaiKx about 8 years
    this will remove the phpmyadmin too
  • mckenzm
    mckenzm over 7 years
    It's a web application, unless you are using curl this is not going to work without a browser. Why not a local subnet. Better still leave it like this and open it on demand by reconfiguring on the fly.
  • JPS
    JPS over 7 years
    This was what I was looking for, couldn't find any reference to phpmyadmin in my apache sites config. This explains that, because it's a module.
  • JohnnyAce
    JohnnyAce about 7 years
    Great answers, this helped me a lot, sometimes I just want to enabled it :)
  • Stephan-v
    Stephan-v about 7 years
    "You are technically correct - the best kind of correct"
  • mfnalex
    mfnalex almost 7 years
    Best answer so far. I just created two script called "phpmyadminenable" and "phpmyadmindisable" so I can enable it whenever needed, and disable it afterwards. thanks.
  • mfnalex
    mfnalex almost 7 years
    combining this with creating a disable/enable script with the commands from Litehouse's answer is probably the most secure way to use phpmyadmin from any device while preserving a reasonable security!
  • Eric
    Eric over 6 years
    Don't do this. You'll remove the whole instance of phpmyadmin not just the login page.
  • nonbeing
    nonbeing almost 6 years
    This should be the selected answer.
  • Mohandes
    Mohandes about 4 years
    And the location of config file on windows wamp server: /wamp/apps/phpmyadminx.x.x/config.inc.php
  • oussama benounnas
    oussama benounnas about 3 years
    i think this is the right answer not the one above