7

So, today for the first time i installed XAMPP/LAMPP on Ubuntu 15.10. Apache server is working fine, but when i try to go to 'localhost/phpmyadmin' I get the following error: enter image description here

And believe me i searched through whole internet, stack overflow, apache friends, etc. and none of given solutions worked for me... So this is my config.inc.php file:

<?php
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie'; 
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
/* Server parameters */
//$cfg['Servers'][$i]['host'] = 'localhost';
//$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;

/**
 * phpMyAdmin configuration storage settings.
*/

/* User used to manipulate with storage */
// $cfg['Servers'][$i]['controlhost'] = '';
// $cfg['Servers'][$i]['controlport'] = '';
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';

/* Storage database and tables */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['relation'] = 'pma__relation'; 
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords'; 
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['recent'] = 'pma__recent'; 
// $cfg['Servers'][$i]['favorite'] = 'pma__favorite';
// $cfg['Servers'][$i]['users'] = 'pma__users'; 
// $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
// $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
// $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
// $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
 // $cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
 // $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
/* Contrib / Swekey authentication */
// $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';

So you can see that my user = root and password is empty. But it simply doesn't work, i tried to change user/pass, tried to change controluser and controlpass, but nothing seems to work. Do you have any idea on how i can fix this problem?

3
  • 1
    Do you have a user "pma" with no password, defined in this MySQL server? Because your configuration is asking phpMyAdmin to try a connection with such user. Commented Oct 27, 2015 at 20:13
  • No, i didn't define anything in MySQL server? Can you explain me how should i do it? Commented Oct 27, 2015 at 20:26
  • See my new answer below. Commented Oct 27, 2015 at 20:31

11 Answers 11

20

reinstall phpmyadmin and try

Code:

sudo dpkg-reconfigure phpmyadmin

if that doesn't work then try Code:

sudo apt-get --purge remove phpmyadmin

then reinstall, if that doesn't work I'm willing to bet it doesn't matter and do Code:

sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf

and restart apache Code:

##sudo /etc/init.d/apache reload sudo service apache2 reload

Sign up to request clarification or add additional context in comments.

Comments

7

According to the config.inc.php you've posted, your root user password is 1234 (as I see in the line $cfg['Servers'][$i]['password'] ='1234';), but later in the file when you're defining the controluser, you use a blank password.

I suggest setting up an actual controluser with fewer permissions than root has, but the quick fix would be to edit and make this change: $cfg['Servers'][$i]['controlpass'] = '1234';

To create a controluser account, use an SQL command similar to this:

GRANT SELECT, INSERT, UPDATE, DELETE ON <pma_db>.* TO 'pma'@'localhost'  IDENTIFIED BY 'pmapass';

substituting the name of your phpMyAdmin configuration storage database (probably 'phpmyadmin') for <pma_db> and a custom password for pmapass.

Comments

3

Uncomment: ...

$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost'; //<--UNCOMMENT THIS
$cfg['Servers'][$i]['connect_type'] = 'tcp'; //<--UNCOMMENT THIS

...

Since you need this to connect via localhost.

2 Comments

Thanks for answer. I tried it right now, and it didn't fix it.
OK. There must be something else with your config file. If I comment these two lines i get the exact same error on my machine.
3

Start by commenting out the controluser and controlpass lines in config.inc.php. Then you'll be able to log in with root, and use the Privileges or User accounts menu to add this pma user. It's explained in the documentation.

3 Comments

When i comment out 'controluser' and 'controlpass' in config.inc.php and try to login as root, the "Connection for controluser as defined in your configuration failed" error disappear but "Cannot log in to the MySQL server" stays.
This means that you don't have the correct login information, or that the MySQL server is not running.
Alright man, i was not running MySQL server from XAMPP manager. Thanks for answer man, you are legend. So much time spent on this... Anyway, thank you very much.
2

Find the file config.default.php and replace

$cfg['Servers'][$i]['host'] = 'localhost'; 

with

$cfg['Servers'][$i]['host'] = '127.0.0.1';

then log in.

Comments

2

I had a similar issue. I was able to do fix by following the video tutorial https://www.youtube.com/watch?v=NSX-ib2aMDQ

i just added skip-grant-tables to my.ini file. Below is a sample portion of my.ini file.

# Example MySQL config file for small systems.
#
# This is for a system with little memory (<= 64M) where MySQL is only used
# from time to time and it's important that the mysqld daemon
# doesn't use much resources.
#
# You can copy this file to
# C:/xampp/mysql/bin/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is C:/xampp/mysql/data) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MySQL clients
[client]
# password       = your_password 
port=3306
socket="C:/xampp/mysql/mysql.sock"


# Here follows entries for some specific programs 

# The MySQL server
default-character-set=utf8mb4
[mysqld]
skip-grant-tables
port=3306
socket="C:/xampp/mysql/mysql.sock"
basedir="C:/xampp/mysql"
tmpdir="C:/xampp/tmp"
datadir="C:/xampp/mysql/data"
pid_file="mysql.pid"
# enable-named-pipe
key_buffer=16M
max_allowed_packet=1M
sort_buffer_size=512K
net_buffer_length=8K
read_buffer_size=256K
read_rnd_buffer_size=512K
myisam_sort_buffer_size=8M
log_error="mysql_error.log"

Comments

1

It happened the same to me. But here's how I fixed it. Just reboot your browser whenever it gives you that error and log into the phpMyAdmin again. No code required, no configurations manipulation required

Comments

1

Hey pal no need to change any file.. Its basically because your mysqli isnt running .. Check control panel for "action" column . You should see "Start" meaning its off, Your php can't speak to a sleeping database gate's locked.. That's why

To Solve it... Open the folder you installed the xampp app into, then click on xammp start and then accept all necessary approvals..

Comments

1
sudo reboot

then start mysql if not auto start

sudo service mysql start

Comments

1
sudo chown -R mysql:mysql /var/lib/mysql 

worked for me.

Comments

-2

Purging the phpmyadmin and install again worked for me.

Purge phpmyadmin using this command:

    sudo apt-get purge --auto-remove phpmyadmin

and install again:

    sudo apt-get install phpmyadmin

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.