How to connect mysqli_real_connect in Ubuntu?

30-Mar-2023

.

Admin

How to connect mysqli_real_connect in Ubuntu?

Hello Friends,

In this tutorial, I will show you how to connect mysqli_real_connect in ubuntu. let’s discuss how to connect to mysqli_connect in php. I explained simply how to connect mysql to php in ubuntu. This article goes into detail on how to connect mysql_real_connect to mysql in ubuntu.

mysqli_real_connect(): (HY000/2002): No such file or directory" - In this tutorial, you will learn how to fix/resolve the error "mysqli_real_connect(): (HY000/2002): No such file or directory" or "connection refused" in PHPMyAdmin on Linux Ubuntu with Apache

Step 1: Login to Your SSH Server


First of all, you need to login into your ssh server with a username and password.

Step 2: Edit MySQLd.conf File

Then execute the following command into your terminal:

nano /etc/mysql/mysql.conf.d/mysqld.cnf

OR

vi /etc/mysql/mysql.conf.d/mysqld.cnf

After that, add the following line to your MySQL.cnf file:

innodb_force_recovery = 1

Step 3: Stop and Start MySQL Server

Finally, execute the following command into your terminal to stop and start your mysql server:

sudo systemctl stop mysql.service ---to shut it down

sudo systemctl start mysql.service ---to try and start up and see the reason why it is not starting.

I hope it can help you...

#Ubuntu