Asked  5 Months ago    Answers:  5   Viewed   115 times

I keep getting the following errors with mysql connection through XAMPP and I don't know what to do:

enter image description here

That's the code in the config.inc.php

<?php
/*
 * This is needed for cookie based authentication to encrypt password in
 * cookie
 */
$cfg['blowfish_secret'] = 'xampp'; /* YOU SHOULD CHANGE THIS FOR A MORE 
SECURE COOKIE AUTH! */

/*
 * Servers configuration
 */
$i = 0;

/*
* First server
*/
$i++;

/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';

/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';

/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';

/* Advanced phpMyAdmin features */
$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]['designer_coords'] = 'pma__designer_coords';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$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';
$cfg['Servers'][$i]['favorite'] = 'pma__favorite';

/*
 * End of servers configuration
 */

?>

I've already reset the password from MySql from the command line two times and added the changes to this code above and to the php.ini file, but at each time it goes back to the error. Any help?

 Answers

39

yo need create the user "pma" in mysql or change this lines(user and password for mysql):

/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma'; 
$cfg['Servers'][$i]['controlpass'] = '';

Linux: /etc/phpmyadmin/config.inc.php

Tuesday, July 13, 2021
 
ShadowZzz
answered 5 Months ago
15

So as you are telling that your are just started with php using ubuntu my advise is to start from scratch, here it's a small guite:

  • Install all you will be needing:

    sudo apt-get install apache2 php5 mysql-server phpmyadmin

  • Once all it's installed you will be using the following directories

    /var/www -- here its where your server stores your pages

    /var/log/apache2/ -- here it's where logs are stored (quite helpful when apache fails,check out the error.log file in that directory)

    /etc/apache2 -- apache configuration lives here

    /etc/php5/cli -- this is where configuration for php5 console live (when you use ~$ php5 test.php the configuration is read from here)

    /etc/php5/apache2 this is where configuration for php5 server live (when you access from a browser like http://localhost/test.php )

The configuration files out of the box dont need to be modified (maybe for more advance uses you will need to modify them)

To uninstall xamp here its a thread might be helful: http://www.apachefriends.org/f/viewtopic.php?p=135389 . First remove xamp and then follow my instructions

Wednesday, March 31, 2021
 
DiglettPotato
answered 9 Months ago
85

If you are using the Bitnami version of Xampp you will have issues with Windows 10. Download and install an older version from sourceforge.net and it should work. I used version 1.7.3 and so far so good. http://sourceforge.net/projects/xampp/files/XAMPP%20Windows/

Saturday, May 29, 2021
 
ariel
answered 7 Months ago
73

You're at risk of MySQL injections. Never insert data directly to a database without some sort of projection first. It's a major security risk. Also use mysqli_real_escape_string instead, and note that your $_POST[webSite] is unprotected.

Also, your error means that your database details are not correct.

Monday, August 23, 2021
 
LunaLoveDove
answered 4 Months ago
43

First of, I can't imagine the reason why you've deleted root user. But back to the question - you should specify WITH GRANT OPTION, like this:

(However this should be opted after you get the mysql re-installed as if you don't have the root access and the user is not having the sufficient privileges also, then the best is to restart the install process and make the user and grant them privileges the way defined below)

mysql> create user 'golden'@'localhost' identified by 'password';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all privileges on *.* to golden@localhost with grant option;
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

and then

mysql> select current_user();
+------------------+
| current_user()   |
+------------------+
| golden@localhost |
+------------------+
1 row in set (0.00 sec)

mysql> create database testing;
Query OK, 1 row affected (0.03 sec)

mysql> grant all privileges on testing.* to test;
Query OK, 0 rows affected (0.02 sec)

mysql> drop database testing;
Query OK, 0 rows affected (0.12 sec)

-but yet again, think twice before deleting root user.

Wednesday, October 20, 2021
 
Alan Clark
answered 2 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :
 
Share