xampp phpmyadmin access denied error(#2002) on linux - php

I installed xampp in my pc(Linux endless os 3). Php is working fine but when I open my http://localhost/phpmyadmin in the browser it is displaying an error
2002 - No such file or directory — The server is not responding (or the local server's socket is not correctly configured).
Error is shown as below

Open the file config.inc.php in any text editor.
Find this line
$cfg['Servers'][$i]['host'] = 'localhost';
And change it to
$cfg['Servers'][$i]['host'] = 'localhost:3307';
I find this solution in this website http://throughthesql.blogspot.com/2017/05/configuring-phpmyadmin-to-connect-to.html

Related

Problem with php and mysql connection xamp

So I am a user of windows 10 and have xammp in my computer. When I first try to run MySQL server, had problem with 3306 port because I didn't had configured ports free. So I changed it to run on port 3307 and it worked.
After that I am trying to connect to localhost/phpmyadmin, and for a reason I just can't....
Anybody have any advice/idea what is going on ?
On the xampp config file : xampp\phpMyAdmin\config.inc:
ADD THIS LINE
$cfg['Servers'][$i]['port'] = '3307';]
(I just found the answer, so... I thought would be good to leave this here.. )

Connecting file to phpMyAdmin error

This problem I am having trouble with, I have been looking at it for a few hours now. So basically I am working on a registration form on my website, and while working on the php, I connected it to MySQL and Database with this line of code (which is the 6th line of code):
$mysqli = new mysqli('localhost:8080', 'root', 'mypass123', 'accounts');
I use Xampp on a Mac and when I try to register it works just not fully so, the problem is it shows this error:
Warning: mysqli::__construct(): (HY000/2002): Connection refused in /opt/lampp/htdocs/form.php on line 6
if this is not enough information, I am sorry but I am new.
PHP expects to use port 3306 for MySQL. So you need to open XAMPP, and change the XAMPP MySQL port to 3306, then restart the MySQL server.
Stop Xampp
Open xampp/mysql/bin/my.ini
Edit MySQL port to 3306
Restart Xampp
I'd say that it's already set to 3306 so just check what it's currently set to and update the setting in your PHP/phpMyAdmin to 3306 instead of 8080. 8080 is generally for the web server.

Error from phmpMyAdmin when is configured in order to access remote server with local phpMyAdmin client

In order to access to a remote database I have edited config.inc.php and at the end of it, before the end ?> I have added :
$i++;
$cfg['Servers'][$i]['host'] = 'HostName:port'; //provide hostname and port if other than default
$cfg['Servers'][$i]['user'] = 'userName'; //user name for your remote server
$cfg['Servers'][$i]['password'] = 'Password'; //password
$cfg['Servers'][$i]['auth_type'] = 'config'; // keep it as config
but when I connect using browser I have this error message:
Notice in ./libraries/common.inc.php#1204 Undefined variable: i
Backtrace
./phpmyadmin.css.php#14: require_once(./libraries/common.inc.php)
The versions are:
PHP 5.4.16 Development Server
phpMyAdmin 4.4.15.10
MySQL 5.6.32 - MySQL Community Server (GPL)
phpMyAdmin works well with local database, without configure common.inc.php
In the middle of common.inc.php there's this instruction unset($i), but how can I use the i variable a the end of common.inc.php if it is no longer available ?
I have initialized i in this way
$i=2;
now I see a drop down menu with server name, but when I selected one of them it returns to localhost.
Using mysql command to connect to the remote database server and using the same user/password, I can successfully connect to the database server.
On client server I'm using Linux, on remote I'm using Windows 7
I have entered another request regarding the server selection problem only at phpMyAdmin can't connect to remote sever on Windows 7 from Linux client
It's a Notice that occurs when you access a variable that is not defined. In your case the variable is $i.
Define is first as below
$i = 0;
Then use it in rest of your code.

How can i configure phpmyadmin?

I install xampp server in vm and i accessed to it from another machine, for xampp server it work but i have this problem in phpmyadmin when i navigate to https://ip/phpmyadmin:
MySQL said: Documentation
#2002 – The server is not responding (or the local MySQL server’s socket is not correctly configured)
i configure file config.inc.php and i change $cfg['Servers'][$i]['host'] = 'localhost'; localhost to my adress ip but it always same problem.
How can i fix it?
I want to have access remote to phpmyadmin.

#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)

I can't access to PHPMyAdmin. when i want to go there, i got this error:
#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)
I googled this error but it don't clear.
I try to know that which port is open by this code :
pgrep mysql
two ports are open when mysql is running.
I want to access to PHPMyAdmin in my localhost. I am using Ubuntu OS
In Ubuntu, by default mysql is not listening to TCP/IP connections. It just uses a local socket.
The current local socket is configured in /etc/mysql/my.cnf . If you open this file, you should find something similar to:
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
What you should do is just to open PHPMyAdmin's config file (config.inc.php) and change the socket address. Maybe there's no local socket configuration on your PHPMyAdmin, or maybe it is different. This file should contain a line like (of course, adapt the address to what you found on my.cnf):
$cfg['Servers'][$i]['socket'] = '/var/run/mysqld/mysqld.sock';
Steps just to run the mysql server after crash.
** Worked on wamp server **
Check the {System name}.err file inside your mysql data directory.
From the log find out the databases causing issues
Cut them out from the data directory (keep in some safe places).
Start mysql service
go to C:\Windows\System32\drivers\etc edit host add 127.0.0.1 localhost
and restart server refrance check ans
This means that mysql server is not started.
This is very simply if you are using wamp left click the wampserver icon then mysql then services then install service after that restart wamp and the problem is solved

Categories