XAMPP - Error establishing a database connection after changing port - php

MySQL shut down unexpectedly on XAMPP. Then I changed the port number 3306 to 3307 to both my.ini and config.inc.php file.
Now MySQL is running and localhost/phpmyadmin/ also running.
But my WordPress website not showing. The problem is -
Error establishing a database connection

Probably you've forgot to change MySQL port in the wp-config.php file in your WordPress website folder.

Related

xammp and wordpress installation for the first time

I had already installed mysql ,and later i installed the xammp the apache is starting but mysql is not starting so i changed the port to 3307,cahging the port from 3306 to 3307 helped to start the mysql,the next problem i faced was while installing wordpress, i created a database and even after filling in the username password and host detalis correctly it says "Error establishing a database connection" in the root directory of wordpress there is a file 'wp-config-sample.php'.
How do i establish connection with the mysql database?

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.

How to fix "Cannot connect: invalid settings" using phpMyAdmin on XAMPP (HY000/2054)

I changes port of MySQL 3306 to 3307 and creats a new user. But I can't access to phpMyAdmin.
Change Port in XAMPP/mysql/bin/
As Apache port, we also can NOT change the MySQL port through the XAMPP Control Panel, to change it we have to edit MySQL configuration file.
To edit the configuration file, open my.ini file located in the XAMPP/mysql/bin/ directory, find words that contain number 3306, eq: port = 3306, then replace it with your own, such as 3307. and save it

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.

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.

Categories