mysqli_real_connect(): (HY000/2002): No such file or directory

mysqli_real_connect(): (HY000/2002): No such file or directory

mysqli_real_connect(): (HY000/2002): No such file or directory or connection denied PHPMyAdmin on linux ubuntu apache server, the error occurs because the Mysqld configuration is misconfigured or has the wrong permission set of mysqld.conf file.

Just connect to your ssh server from terminal window, and open the mysqld.conf file with the help of the command nano /etc/mysql/mysql.conf.d/mysqld.cnf and then add an innodb_force_recovery = 1 line in it to fix mysqli: :real_connect(): (hy000/2002): No such file or directory or connection rejected phpmyadmin with linux ubuntu server.

mysqli_real_connect(): (HY000/2002): No such file or directory

Steps to fix mysqli_real_connect(): (HY000/2002): No such file or directory or connection refused PHPMyAdmin ubuntu linux server:

Step 1 – Login to Your SSH Server

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

Step 2 – Edit MySQLd.conf File

Run the following command into your terminal to edit mysqld.conf file:

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 MySQLd.cnf file:

innodb_force_recovery = 1

Step 3 – Stop and Start MySQL Server

Finally, restart the mysql server by running the following commands on the terminal to apply the changes and resolve your errors:

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.

Conclusion

That’s it; you have learned how to fix mysqli_real_connect(): (HY000/2002): No such file or directory or connection refused PHPMyAdmin on linux ubuntu apache.

Recommended Tutorials

AuthorAdmin

Greetings, I'm Devendra Dode, a full-stack developer, entrepreneur, and the proud owner of Tutsmake.com. My passion lies in crafting informative tutorials and offering valuable tips to assist fellow developers on their coding journey. Within my content, I cover a spectrum of technologies, including PHP, Python, JavaScript, jQuery, Laravel, Livewire, CodeIgniter, Node.js, Express.js, Vue.js, Angular.js, React.js, MySQL, MongoDB, REST APIs, Windows, XAMPP, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL, and Bootstrap. Whether you're starting out or looking for advanced examples, I provide step-by-step guides and practical demonstrations to make your learning experience seamless. Let's explore the diverse realms of coding together.

Leave a Reply

Your email address will not be published. Required fields are marked *