how to solve phpmyadmin does'nt access in localhost? - php

Welcome to phpMyAdmin
Error
MySQL said: Documentation
Cannot connect: invalid settings.
Connection for controluser as defined in your configuration failed.
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

if you use xampp you should turn on the mysql and apache

Related

Access denied While using phpmyadmin XAMPP

I have installed XAMPP on windows 10 but cannot open phpMyAdmin. I had to change Apache port 443 to 4433 because of conflicts and now both apache and mysql are running. When I click on phpMyAdmin on my server it gives me the following message in a pink box:
MySQL said: Documentation
Cannot connect: invalid settings.
mysqli::real_connect(): (HY000/2002): No connection could be made because the target machine actively refused it.
Connection for controluser as defined in your configuration failed.
mysqli::real_connect(): (HY000/2002): No connection could be made because the target machine actively refused it.
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
I've read the questions on similar problems but they mostly happened when someone changed the password, but for my case, the user is set to root and the password is empty both in MySQL server connection and in the config.inc.php file. I have no clue where to look for the problem.
What version is your XAMPP? Try going to task manager, locate mysqlI and end task. Now close the XAMPP window and open it again. Go to Mysql and try test the connection by connecting to the database on port 3306. If it gives en error check the error log in the XAMPP.

mysql Cannot connect: invalid settings

My phpMyAdmin stopped connecting to mySQL suddenly with the following error:
Error MySQL said: Documentation
Cannot connect: invalid settings. phpMyAdmin tried to connect to the
MySQL server, and the server rejected the connection. You should check
the host, username and password in your configuration and make sure
that they correspond to the information given by the administrator of
the MySQL server.
I am running MAMP with php7 on a MAC.
I have checked my config.inc.php setting and both user and password
are set to root.
I have checked the httpd.conf file and changed the port from 8888 to 80
I have also reverted back on mamp controlpanel from php 7 to php
5.6.10.
And always stopped apache and restarted between changes. None of these changes have had any effect. Really don't understand why it suddenly stopped working.
I can still access mysql from Sequel Pro and MySQLWorkbench.
Thankful for any suggestions :)

Connection for controluser as defined in your configuration failed -- error on my xampp server can't login in to my phpmyadmin

I have searched in internet and stackexchange nothing worked for me. That's why I have created the same question again.
I am using php 5.6
I am using Xampp
Errors:
1. MySQL said:
Cannot connect: invalid settings.
Connection for controluser as defined in your configuration failed.
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
Connection for controluser as defined in your configuration failed
Under my Xampp server MySQL started
Help me to login in to my phpmyadmin and solve this problem.
Thank in advance

PHP 5.3 Upgrade - Can't Connect to MySQL Server

I've done a bit of research on this today, but nothing seems to address this issue. I recently upgraded to PHP 5.3.3 from 5.1.6, as well as upgraded MySQL to 5.5 from 5.0. Afterwards, the following code generates an error saying "Can't connect to mysql database":
$connection = mysql_pconnect($dbhost, $dbusername, $dbpassword);
if (!$connection) {
//Can't connect
die('Could not connect: ' . mysql_error());
return;
}
And get the following error:
Warning: mysql_pconnect(): Can't connect to MySQL server on '199.59.157.103' (13) in /var/www/html/ws/Cust/customerWS_1_1.php on line 19 Could not connect: Can't connect to MySQL server on '199.59.157.103' (13)
I am able to connect to the remote host via the command line, and have tried everything from resetting the password to shutting down IP Tables. I'm kind of at a loss - so any help would be appreciated.
We had a similar problem with the same error message "Can't connect to mysql database" and maybe the following points will be also usefull:
check mysql user privileges (in our case and with external connections we had the old server IP address (allow access) in the table) GRANT ALL PRIVILEGES ON tablename.* TO 'username'#'145.1.1.2';
-> reload privileges after changes (FLUSH PRIVILEGES;)
disable the SELinux parameter. In new Plesk versions (>10?) this would be set enabled automatically...
--> in /etc/selinux/config change the line that says:
SELINUX=enforcing to SELINUX=disabled
See further details: http://googolflex.com/?p=482
There is a PHP 5.3 mysql driver restriction related to old authentication scheme hash stored in the database by previous mysql server. This could cause a problem with stored passwords so the databases will be unaccessible with old passwords.
To solve the problem you should recreate the mysql users with the same login and same password.
When you say "I am able to connect to the remote host via the command line" do you mean, you are connecting to the MySQL server REMOTELY? Or that you are SSHing to your MySQL server and connecting to it from the MySQL server's command line? If the latter, it's possible that when you upgraded to MySQL 5.5 you accidentally stopped MySQL from binding / listening on a public IP. Check your my.cnf.
Otherwise: is your PHP code being run on the same server as your MySQL server? It's possible that your permissions could be off. MySQL permissions are very particular about connecting to the MySQL server via it's IP address if the client only has access to connect from 'localhost', and vice-versa.
First you should make sure that the connect parameters $dbhost, $dbusername and $dbpassword are correct. Assuming these are correct, you should check your mysql ini settings. I would assume that the bind-address is set to 127.0.0.1 or localhost, but not to a public IP address.
Also note that it's a security risk if you can connect to mysql from a public IP address. You may want to look into a solution that does not require such connection.

Logging with a user in a remote MySQL database

How to log with a diferent user in a MYSQL remote database?
Here's what I've done:
Logged as root in the MYSQL:
'create user 'user'#'%' IDENTIFIED BY 'password';
'grant select on *.* to 'user'#'%';
Then I setted a PHP script which connection is this one:
$con = mysql_pconnect("xxx.xx.xxx.xxx","user","password");
$selected = mysql_select_db("database",$con);
Aaaand it isn't working:
I'm using LAMP on a cloud server, by the way;
Warning: mysql_pconnect() [function.mysql-pconnect]: Can't connect to MySQL server on 'xxx.xx.xxx.xx' (10061) in D:\path\index.php on line 21
What am I doing wrong?
EDIT: Not a firewell issue;
You might want to check the MySQL documentation on this specific problem. If I had to guess, I would say that your MySQL server may be bound only to the local (127.0.0.1) address. To troubleshoot you should probably try connecting to the server using the command line MySQL client in order to get a better idea of why exactly the connection isn't being made.
Seems to me like a firewall issue. You should check if the machine hosting the MySQL server allows connection on the port 3306 from external IPs as well.
Check if the server you have to connect to has the firewall open on the port you are trying to connect... default port is 3306
you can use
mysqladmin -h localhost
to see check what is the port mysql is using

Categories