Article directory
💻🔧【Super Easy Tutorial】Step-by-step guide to modifying phpMyAdmin configuration and resolving MySQL import failures❗️
Tested and proven effective! ✅ It only takes three minutes ⏰ to completely solve the problem of MySQL being unable to access the uploaded folder 📂.
No more headaches about importing databases💡, easily manage your database📊 and make your Linux system run more smoothly🌟.
What to do if importing a MySQL database fails on Linux ? Here's how to modify the phpMyAdmin configuration!
To find the installation path of phpMyAdmin, you can use the following command:
find / -name pma
Or
find / -name phpMyAdmin
If you find a path similar to the following:
/usr/local/cwpsrv/var/services/pma /usr/local/apache/htdocs/phpmyadmin

Installation path of phpMyAdmin
Well, congratulations, you have locked the installation location of phpMyAdmin!
Some control panel programs will install it in the `pma` folder, while others prefer to put it in the `phpMyAdmin` folder.
You may find these paths:
/usr/share/phpmyadmin /usr/share/phpmyadmin/vendor/phpmyadmin /usr/local/hestia/install/rpm/phpmyadmin /usr/local/hestia/install/deb/phpmyadmin /var/lib/mysql/phpmyadmin /var/lib/phpmyadmin /etc/phpmyadmin
After testing, it was finally confirmedHestiaCPphpMyAdmin installation path:/etc/phpmyadmin
Next, you can log into phpMyAdmin, select the database, and click "Import." However, the import functionality may be limited by default.
However, we can modify the phpMyAdmin configuration file to allow it to support importing MySQL database files from the server. The specific steps are as follows:
Modify phpMyAdmin configuration file
Find and edit the `config.inc.php` file. If there is only `config.sample.inc.php`, make a copy and rename it to `config.inc.php`.
1. Find the following configuration:
$cfg['UploadDir'] = ''; $cfg['SaveDir'] = '';
2. Modify to:
$cfg['UploadDir'] = '/tmp'; $cfg['SaveDir'] = '/tmp';
Attention points
Please note that the /tmp folder here is in the root directory of the server.
You can then upload the MySQL files to this /tmp directory. Use SFTP to put the files in /tmp and then select Import in the database management of phpMyAdmin (you may need to log in again to see the changes).
If you are using HestiaCP, sometimes phpMyAdmin may not support the default path. In this case, modify the phpMyAdmin configuration file and change the path to the website user's `tmp` directory:
$cfg['UploadDir'] = '/home/admin/tmp'; $cfg['SaveDir'] = '/home/admin/tmp';
If you encounter "Upload folder from website server`/home/admin/tmp/If "No files can be uploaded!" is displayed in the "Select" menu, it means that the folder permissions are insufficient.
Just add `/home/admin/tmp`Set the directory permission to `755`:
sudo chown www-data:www-data /home/admin/ -R sudo chmod 755 /home/admin/ -R
Now, you can happily import your MySQL files from this path! 🚀
If you have tried the above methods and importing a MySQL database using phpMyAdmin still fails, or you encounter a 500 error when importing a MySQL database, you can try the following methods▼
Hopefully, the article "How to Modify phpMyAdmin Configuration to Solve the Problem of No Uploadable MySQL Database Files?" shared on Chen Weiliang's blog ( https://www.chenweiliang.com/ ) will be helpful to you.
Feel free to share this article's link: https://www.chenweiliang.com/cwl-157.html
