phpmyadmin MySQl error (Cannot connect: invalid settings.) - php

When I open http://localhost/phpmyadmin/ , I get this error :
How can I fix it ?

Related

Mysql Remote Connection Failed

Im trying with php to connect my remote server's mysql im getting this error:
"Database Connection Error: SQLSTATE[HY000] [2002] connection refused"
I made what said in that page : https://www.configserverfirewall.com/ubuntu-linux/enable-mysql-remote-access-ubuntu/
this is my setting now:
and ofcourse restarted mysql.
ANd its still saying same error "Database Connection Error: SQLSTATE[HY000] [2002] connection refused"
What can i do else?
this is my connection setting:
When i try port 3306 same error. What can cause that?
ps: also this is a remote connection from a hosting shared to my dedicated server
it was about cloudflare or other proxies. Fixed.

phpmyadmin access denied after installing manually mysql

I tried to install mysql after I already had xampp, I changed the password and now I'm getting this errors when I try to access phpmyadmin
Error
MySQL said: Documentation
#2002 - No connection could be made because the target machine actively refused it.
— The server is not responding (or the local server's socket is not correctly configured).
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.
I tried everything, including changing the password in confing.inc.php
and try to reset the password from cmd, when I tried this I got this error:
MySQL [(none)]> SET PASSWORD FOR 'root'#'localhost' = PASSWORD('');
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PASSWORD('')' at line 1

PHP Connection Erreur : SQLSTATE[HY000] [2002] A connection attempt failed

It's the first time I ask a question on a forum.
I'm making a quizz with a basic html form and need to save the answers on my server (using lcn.com company for hosting it).
Server details:
Host: database3.lcn.com
User: xxx
pwd: xxx
Alright, I'm simply trying to connect to my MySQL database using PHP language.
I've pasted here my php file:
<?php
$dsn='mysql:host=database3.lcn.com;dbname=test_table;charset=utf8';
$user="***";
$pwd="***";
try {
$linkpdo = new PDO ($dsn,$user,$pwd);
echo "Success!";
$linkpdo=null;
} catch(Exception $e) {
die('Erreur : '.$e->getMessage());
}
?>
But I have this problem :
Erreur : SQLSTATE[HY000] [2002] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
And don't know why it doesn't work...
Could someone please give me a hand?
Thanks
mysql --version
sudo service mysql restart
sudo mysql

Setting up MySQL issue under Eclipse PHP

I have a snippet of code under the PHP file in Eclipse PHP.
$username = mysql_real_escape_string( $username );
It generates an error Warning:
mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /web_development/php_work/new_test/test.php on line 37
Looks like the Eclipse PHP couldn't connect to the MySQL of XAMPP, so How do I fix that?
I added two lines
#mysql_connect('localhost','root', '') or die('Could not connect to : ' . mysql_error());
#mysql_select_db('test') or die( "-Unable to select database");
but Eclipse still throws me.
mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to local MySQL server through socket '/tmp/mysql.sock'
thx.

Can't Connect to PostgreSQL with PHP pg_connect()

EDIT: I just realized that this question may be better suited to ServerFault. Instead of copying it, a moderator please move it over? Thanks.
I've checked php-info, and the Postgresql extension is there (pg_connect() is not undefined). I am also able to connect to postgresql using psql on localhost (I've edited my pg_hba.conf file appropriately). Here is the code that's not working:
<?php
$dbconn = pg_connect("host=localhost port=5432 dbname=mydb user=myuser password=mypass") or die('Could not connect: ' . pg_last_error());
?>
This code simply results in "Could not connect: " being displayed in the browser.
I checked my apache log, and here's the relevant error message:
PHP Warning: pg_connect() [<a href='function.pg-connect'>function.pg-connect</a>]:
Unable to connect to PostgreSQL server: could not connect to server: Permission
denied\n\tIs the server running on host "localhost" and accepting\n\tTCP/IP
connections on port 5432?
How can I fix/debug this?
Edit: I'm on Centos 5.4 btw.
could not connect to server: Permission denied
Edit: I'm on Centos 5.4 btw.
Check /var/log/audit/audit.log. Chances are that you're hitting a SELinux rule.

Categories