phpMyAdmin - what' swrong with next configuration? - mysql

tryin to install phpMyAdmin on my Fedora server, but if i open it in browser, i get next error:
2002 Cannot log in to the MySQL server
file config.inc.php have next content:
<?php
/* Servers configuration */
$i = 0;
/* Server: localhost [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = '';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '123';
/* End of servers configuration */
$cfg['blowfish_secret'] = '4c45c50fe8b283.01675296';
$cfg['DefaultLang'] = 'en-utf-8';
$cfg['ServerDefault'] = 1;
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
?>
just to add, in mysql i created user root, with password 123, so i can log in with:
mysql -h localhost -u root -p123
can you help me where is the problem?

mysql -h localhost actually connects via unix socket instead of a TCP connection to 127.0.0.1. Explicitly specifying mysql -h 127.0.0.1 on the other hand does use the TCP method.
So what you are testing is a local socket connection, not a network one. Make sure phpMyAdmin uses the same method; the line
$cfg['Servers'][$i]['connect_type'] = 'tcp';
should probably read
$cfg['Servers'][$i]['connect_type'] = 'socket';
Your mysqld probably has either networking disabled or user permissions denying root/123 access from the network.
With -h localhost in your example you are actually connecting over a named socket. You can see for yourself - from the mysql client type "\s":
mysql> \s
--------------
(....)
Connection: Localhost via UNIX socket

ok, i solve it.
in configuration file, i just changed 'localhost' to '127.0.0.1', and it started to work.
tnx anw!

Related

XAMPP MySQL said: Cannot connect: invalid settings

MySQL was working fine and then for no reason I start getting this error whenever I open http://localhost/phpmyadmin/
I spent hours here trying to find solutions but all what I've tried did not work.
can someone please help me?
I am using: XAMPP Version: 7.3.6
Thanks
config.inc.php file content
<?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
*/
?>
SOLUTION - TRIED AND TESTED.
open folder >> C:\xampp\mysql\bin
open file (edit) >> my.ini
Add this line
# The MySQL server
default-character-set=utf8mb4
[mysqld]
skip-grant-tables <<<--- Add this line
port=3306
Save file.
Restart XAMPP.
Go to http://localhost/phpmyadmin/
And there you have it.
Run this command
mysqladmin -u root password 'mynewpassword'
$cfg['Servers'][$i]['AllowNoPassword'] = true; <--- change this
$cfg['Servers'][$i]['AllowNoPassword'] = false; <--- to this fixed the problem.
Note: there are other areas in localhost where you have to change the password manually. For example in "CD Collection" example. The password is hard coded there rather than picking it up from config.inc.php.
I do not know why but for some reasons when I start XAMPP control panel as Administrator I can connect to phpMyAdmin with no issues
The error messages are a bit confusing as it mentions MariaDb server. There was a change to WAMP server recently to allow MariaDb, don't know if XAMPP did the same.
WAMP server switch MySQL to MariaDB
Given that it works when you run as Administrator, I'd say it cannot access a settings file when run as normal. Can you check the permissions on config.inc.php?
When it does connect as administrator:
do you have to enter your mySql username and password?
what do you see in the database panel?
Server: Local Databases (127.0.0.1 via TCP/IP)
Server type: MySQL
Server version: 5.7.14 - MySQL Community Server (GPL)
Protocol version: 10
User: root#localhost
Server charset: UTF-8 Unicode (utf8), example:
Possibly a security precaution. You could try adding a new administrator account:
mysql> CREATE USER 'monty'#'localhost' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'#'localhost'
-> WITH GRANT OPTION;
mysql> CREATE USER 'monty'#'%' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'#'%'
-> WITH GRANT OPTION;
https://stackoverflow.com/a/1559992/7528823
I just encountered same problem a few minutes ago, i was sure i didnt need any configuration change so what i did was to clear cookies and site data from 127.0.0.1 (might be localhost instead, in your case) and it was solved!

Cannot log in to the MySQL server (XAMPP)

I am having an issue with logging into phpMyAdmin, specifically when I log in with the root user and the correct password it gives me this error:
Cannot log in to the MySQL server
When I log in using the 'pma' user without password it works, but it doesn't have the permissions I need to use obviously. I'm pretty sure this is the 1045 error.
Here are my settings in config.inc.php:
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'sutdenlol';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';
/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';
If you need more information please tell me instead of down voting.
Edit:
PHP scripts can access the server with root with the correct password.
Try to change
$cfg['Servers'][$i]['host'] = 'localhost';
to
$cfg['Servers'][$i]['host'] = '127.0.0.1';
and check do you have installed MySql Server on your machine. You can download it here - https://dev.mysql.com/downloads/

PHP my admin to connect with Amazon RDS

hello I am trying to connect phpMyAdmin to Amazon RDS. I am successfully connecting the mysql through terminal like this
mysql -h xxxxxxxxxxxxxxxxxxx.rds.amazonaws.com -u myusername -p
and for phpmyadmin I am doing this in config.inc.php file
$i++;
$cfg['Servers'][$i]['host'] = 'xxxxxxxxxxxxxxxxxxx.rds.amazonaws.com';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['compress'] = FALSE;
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'myusername';
$cfg['Servers'][$i]['password'] = 'mypassword';
The problem I am having is If I do this and access the phpmyadmin, My phpmyadmin shows like this
It doesn't show tables columns or anything on the left side. But If I remove this code then everything is back to normal meaning I can see tables

How to change root password of phpmyadmin in WAMP?

I opened mysql console and wrote the following :
SET PASSWORD FOR root#localhost = PASSWORD('temppass') ;
Now when I open phpmyadmin, it says "Access denied for user 'root'#'localhost' (using password: NO)"
I was trying to set a password for root and I read it somewhere that we change root password from console itself, unlike previous versions where we had to alter the config files.
Any detailed tutorial on changing root password to secure a database?
I'm new to all this. Thank you.
Once you have changed the root password you need to tell phpMyAdmin what the new password is as by default the root password is held in the c:\wamp\apps\phpmyadmin4.1.14\phpmyadmin.conf file.
/*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['verbose'] = 'mysql wampserver';
//$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'YOUR_NEW_PASSWORD'; <--change
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
//$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Servers'][$i]['AllowNoPassword'] = false; <--change
A better solution in my opinion is to change this file so that phpMyAdmin throws a login screen so you can enter/test new accounts as well as just root
So I would change c:\wamp\apps\phpmyadmin4.1.14\phpmyadmin.conf to
/*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['verbose'] = 'mysql wampserver';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
//$cfg['Servers'][$i]['auth_type'] = 'config';
//$cfg['Servers'][$i]['user'] = 'root';
//$cfg['Servers'][$i]['password'] = '';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
Now you will get a login screen like this
To change the default mysql root password on xampp, type the following on mysql console:
UPDATE mysql.user SET Password=PASSWORD('som3P#Ss') WHERE User='root';
FLUSH PRIVILEGES;
then open [XAMPP Installation Path] /phpmyadmin/config.inc.php
and modify it to:
$cfg['Servers'][$i]['password'] = 'som3P#Ss';
$cfg['Servers'][$i]['AllowNoPassword'] = false;

Can't see PHPMYADMIN Control Panel

I have a problem with PHPMYADMIN. I'm trying to create a database on local with my Mac but this is what I see when I'm inside PHPMYADMIN: http://i.imgur.com/u7hhGwh.png.
As you can see there is no control panel. It seems like I'm not admin of my PHPMYADMIN or maybe I'm just a guest..
This is the config file of my database:
<?php
/*
* Generated configuration file
* Generated by: phpMyAdmin 4.4.8 setup script
* Date: Thu, 04 Jun 2015 15:01:24 +0000
*/
/* Servers configuration */
$i = 1;
/* Server: localhost [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = '';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
/* End of servers configuration */
$cfg['DefaultLang'] = 'it';
$cfg['blowfish_secret'] = '–––––––––––.––––––';
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
$cfg['ServerDefault'] = 1;
?>
This is what I personally did to solve my problem.
Uninstalled and deleted (is important! delete them totally!) mysql and phpmyadmin from the system. You can find mysql in /usr/local on OSX 10.10
Typed in the terminal bash <(curl -Ls http://git.io/eUx7rg) and then Enter
Wait till the end of the download and a simple guided setup will help you re-installing mysql
Now you should have on your Desktop a file named 'MYSQL_PASSWORD' and it will be the password that you will use with phpmyadmin (nickname is root).