phpmyadmin access denied after installing manually mysql - php

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

Related

php artisan make controller command try connecting to mysql and throwing connection error

when i run any php artisan commands make,key its throwing an error saying
In Connection.php line 664:
SQLSTATE[HY000] [2002] No connection could be made because the
target machine actively refused it. (SQL: select * from system
where key = woocommerce_version limit 1)
In Connector.php line 70:
SQLSTATE[HY000] [2002] No connection could be made because the
target machine actively refused it.
why it tries to connect to mysql database it has nothing to do with it
my server is iis i don't know if its mis-configured, but the same laravel application in localhost shows no error

MySQL server has gone away - Packets out of order. Expected 0 received 1. Packet size=72

I tried to use php to connect to a MySQL sever running on another computer on the same network.
Server IP: 192.168.0.111
My IP: 192.168.0.109
I am currently using XAMPP which I just upgraded to version 8.0.0. After the upgrade, I got a few errors on my screen:
Warning: Packets out of order. Expected 0 received 1. Packet size=72 in C:\xampp\htdocs\submit.php on line 95
Warning: mysqli::__construct(): Error while reading greeting packet. PID=28684 in C:\xampp\htdocs\submit.php on line 95
Warning: mysqli::__construct(): (HY000/2006): MySQL server has gone away in C:\xampp\htdocs\submit.php on line 95
Connection failed: MySQL server has gone away
MySQL server is running on the default port 3306 and here are the latest logs:
2020-12-27 16:11:21 29 [Warning] IP address '192.168.0.109' has been resolved to the host name '192.168.0.109', which resembles IPv4-address itself.
2020-12-27 16:11:21 29 [Warning] Aborted connection 29 to db: 'unconnected' user: 'unauthenticated' host: '192.168.0.109' (This connection closed normally without authentication)
The server is not using any password at the moment.
What can I do to fix this issue?
Thanks.
[update] I see no errors when I use server name as 'localhost' when the php file is on the MySQL server.

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.

when I start apache MySQL server, I get error " (HY000/2002): No connection could be made because the target machine actively refused it."

after the start apache server, i could not access PHPMyAdmin. when i try to access i get an error and auto-stop MySQL server.
- 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..
how can i solve this error
Add below line under config.inc.php
$cfg['Servers'][$i]['port'] = 8111;
If you are on Windows os and the above solution does not work, just check if your mysql is running with "netstat -ano" command, if the services are not running just try starting the mysql service.

Unable to login into MySql after changing default_authentication_plugin=mysql_native_password

I have MySql 8.0 freshly server installed. Initially, I was able to log in, but when I tried to connect to it through PHP PDO I got this error:
Fatal error: Uncaught PDOException: PDO::__construct(): The server
requested "authentication method unknown to the client
[caching_sha2_password]"
I read from StackOverflow a solution here
Open your my.cnf (in my case the my.ini file) and add the following
entry (and restart MySQL)
[mysqld]
default_authentication_plugin=mysql_native_password
Create a user (your MYSQL_USER name) using the correct 8.0 syntax for
generating the password (see below) <---- Altered my existing user
"root"
IDENTIFIED WITH mysql_native_password
Flush the privileges and try again.
After I restarted the MySql service I'm now unable to log in to MySQL. with it saying this error now:
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using
password: YES)
I want to be able to log in through PHP PDO, but I can't even log back in through regular command prompt or MySQL Workbench. Any help on this would be great.

Categories