I keep getting the following errors with mysql connection through XAMPP and I don\'t know what to do:
That\'s the code in the config.inc.php
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
In terminal, log into MySQL as root. You may have created a root password when you installed MySQL for the first time or the password could be blank, in which case you can just press ENTER when prompted for a password.
sudo mysql -p -u root
Now add a new MySQL user with the username of your choice. In this example we are calling it pmauser (for phpmyadmin user). Make sure to replace password_here with your own. You can generate a password here. The % symbol here tells MySQL to allow this user to log in from anywhere remotely. If you wanted heightened security, you could replace this with an IP address.
CREATE USER 'pmauser'@'%' IDENTIFIED BY 'password_here';
Now we will grant superuser privilege to our new user.
GRANT ALL PRIVILEGES ON *.* TO 'pmauser'@'%' WITH GRANT OPTION;
Then go to config.inc.php ( in ubuntu, /etc/phpmyadmin/config.inc.php )
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pmauser';
$cfg['Servers'][$i]['controlpass'] = 'password_here';
I just finished setting up my XAMPP on the MAC and had the same trouble. I just fixed it. It is not quite clear what OS you're using but you need to run the XAMPP security. You indicate you've done that, but here it is anyway for the MAC
sudo /Applications/XAMPP/xamppfiles/xampp security
Set your password on the questions you get.
In you're phpmyadmin import the "create_tables.sql" .. Which can be found in the ./phpmyadmin/sql folder.
Next open the config.inc.php
file inside the ./phpmyadmin
folder.
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = 'you_password';
Make sure to log out and log in to reflect the changes within phpmyadmin
This error is caused by a line of code in /usr/share/phpmyadmin/libraries/sql.lib.php.
It seems when I installed phpMyAdmin using apt, the version in the repository (phpMyAdmin v4.6.6) is not fully compatible with PHP 7.2. There is a newer version available on the official website (v4.8 as of writing), which fixes these compatibility issues with PHP 7.2.
You can download the latest version and install it manually or wait for the repositories to update with the newer version.
Alternatively, you can make a small change to sql.lib.php to fix the error.
Firstly, backup sql.lib.php before editing.
1-interminal:
sudo cp /usr/share/phpmyadmin/libraries/sql.lib.php /usr/share/phpmyadmin/libraries/sql.lib.php.bak
2-Edit sql.lib.php. Using vi:
sudo vi /usr/share/phpmyadmin/libraries/sql.lib.php
OR Using nano:
sudo nano /usr/share/phpmyadmin/libraries/sql.lib.php
Press CTRL + W (for nano) or ? (for vi/vim) and search for (count($analyzed_sql_results['select_expr'] == 1)
Replace it with ((count($analyzed_sql_results['select_expr']) == 1)
Save file and exit. (Press CTRL + X, press Y and then press ENTER for nano users / (for vi/vim) hit ESC then type :wq and press ENTER)
My default 3306 port was in use, so Ive changed it to 8111, then I had this error. Ive fixed it by adding
$cfg['Servers'][$i]['port'] = '8111';
into config.inc.php . If you are using different port number then set yours.
The Connection for controluser as defined in your configuration failed, right after:
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = 'you_password';