Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot login to phpMyAdmin, no errors shown

Tags:

I have MySQL set up correctly on my linux computer, however I want a better way to input data into the database besides terminal. For this reason, I downloaded phpMyAdmin. However, when I try to log in to the phpMyAdmin from index.php, it doesnt do anything. It seems to just refresh the page without doing anything. I am putting in the correct MySQL username and password. What is the issue?

Here is a screen shot of what it shows after I click "go".

enter image description here

like image 541
Braden Steffaniak Avatar asked Jun 13 '12 21:06

Braden Steffaniak


People also ask

How do I access phpMyAdmin login?

You should be able to access phpMyAdmin directly, by browsing to http://127.0.0.1/phpmyadmin. Log in to phpMyAdmin by using the following credentials: Username: root. Password: The same as the application password.

Why is there an error at phpMyAdmin?

A database connection error means that your phpMyAdmin tool is not able to connect to the MySQL database. Usually, this is because the MAMP phpMyAdmin configuration file has the incorrect settings.

How do I access phpMyAdmin through my browser?

Once phpMyAdmin is installed point your browser to http://localhost/phpmyadmin to start using it. You should be able to login using any users you've setup in MySQL. If no users have been setup, use admin with no password to login. Then select Apache 2 for the webserver you wish to configure.


2 Answers

This is a possible issue when the path to save php_session is not correctly set :

The directory for storing session does not exists or php do not have sufficient rights to write to it.

To define the php_session directory simply add the following line to the php.ini :

session.save_path="/tmp/php_session/"

And give write rights to the http server.

usually, the http server run as user daemon in group daemon. If it is the case, the following commands will make it :

chown -R :daemon /tmp/php_session

chmod -R g+wr /tmp/php_session

service httpd restart
like image 89
Mohammad_Hosseini Avatar answered Oct 12 '22 05:10

Mohammad_Hosseini


Login fails if session folder in not writeable. To check that, create a PHP file in your web directory with:

<?php
$sessionPath = 'undefined';

if (!($sessionPath = ini_get('session.save_path'))) {
    $sessionPath = isset($_ENV['TMP']) ? $_ENV['TMP'] : sys_get_temp_dir();
}

if (!is_writeable($sessionPath)) {
    echo 'Session directory "'. $sessionPath . '"" is not writeable';
} else {
    echo 'Session directory: "' . $sessionPath . '" is writeable';
}

If session folder is not writeable do either

sudo setfacl -R -m u:www-data:rwx <session directory> or chmod 777 sudo setfacl -R -m u:www-data:rwx <session directory> -

like image 32
Amadu Bah Avatar answered Oct 12 '22 07:10

Amadu Bah