open http://localhost/phpmyadmin/ ➚ Or it doesn’t open, try to open it by clicking on the http://localhost:8080/phpmyadmin address.
phpMyAdmin is an open source web-based administration tool for managing MySQL and MariaDB databases. It is written in PHP and provides a convenient and easy-to-use graphical interface for managing database operations, such as creating, modifying, and deleting databases, tables, and records. It also offers features for managing users, permissions, and executing SQL queries.
Some of its key features include
: Database management: create, modify, and delete databases and tables. Data manipulation: Insert, update, and delete records in tables. Index and constraint management: Add, modify, or
- remove primary keys, indexes, and constraints. administration
- permissions: Create, modify, and delete users, and grant or revoke privileges.
- Run custom SQL queries and view the results
- : Import and export database structures and data in various formats, such as SQL, CSV, and XML.
of users and
SQL query
execution:
. Import and export
phpMyAdmin is widely used by web developers and database administrators to manage their MySQL and MariaDB databases, especially in shared hosting environments where command line access may be limited or unavailable.
How do I set up phpmyadmin on Windows, Mac and Linux localhost?
To set up phpMyAdmin on Windows, Mac or Linux localhost, you must have a web server, PHP and MySQL or MariaDB installed on your local machine. You can use software packages such as XAMPP (cross-platform), WAMP (Windows), MAMP (Mac), or LAMP (Linux) to set up a local web server environment, including Apache, PHP, and MySQL/MariaDB.
Once you have the necessary components installed, follow these steps to configure PMA
:
-
Download: Visit the download page of the official website on https://www.phpmyadmin.net/downloads/ and download the latest version of phpMyAdmin in a zip or tar file.gz
-
Extract the files: Extract the contents of the downloaded file to a folder. You can rename the folder to something more convenient, such as “pma“.
-
: Move the extracted folder “phpmyadmin” to the document root directory of your web server. This directory is usually called “htdocs” for XAMPP, “www” for WAMP, and “htdocs” or “web” for MAMP/LAMP. This step makes the php admin script accessible through your web server.
-
Configure (optional): Within the installed folder, locate the “config.sample.inc.php” file and make a copy of it. Rename the copied file to “config.inc.php”. Open the “config.inc.php” file in a text editor and update any required settings, such as authentication type or MySQL server host and port. For most users, the default settings work fine, so this step is optional.
-
Access phpMyAdmin through your web browser: Open your web browser and navigate to http://localhost/phpmyadmin (or http://127.0.0.1/phpmyadmin). You should see the script login page.
-
phpMyAdmin: Use your MySQL or MariaDB username and password to log in to the dasboard admin panel. By default, the username is “root” and the password is blank (for XAMPP and MAMP) or “root” (for WAMP). After logging in, you can start managing your databases using the PMA interface.
.
Move the folder to the document root of your web server
Log in to
Remember that if you are using a different port for your web server, you will need to include it in the URL, such as http://localhost:8080/phpmyadmin
. Phpmyadmin does not work on localhost, it gives a connection error, what should I do? If phpMyAdmin is giving you
a
connection error on localhost, there could be several possible reasons. Follow these steps to diagnose and resolve the issue
: Check your web server, PHP and MySQL/MariaDB services
-
: Make sure your web server (Apache or Nginx), PHP and MySQL/MariaDB services are running. If you are using XAMPP, WAMP, or MAMP, open the control panel and make sure that the respective services have been started.
-
: On Windows, open the “Services” application and make sure that the MySQL or MariaDB service is running. On Linux and macOS, open a terminal and use the following commands
Verify that the MySQL/MariaDB service is running
: For MySQL: sudo systemctl status mysqlFor MariaDB: sudo systemctl status mariadbIf the service is not running, start it using the appropriate command:For MySQL: sudo systemctl start mysqlFor MariaDB: sudo systemctl start mariadb
- Check your phpMyAdmin configuration: Open the “config.inc.php” file (located in the “phpmyadmin” folder) in a text editor and make sure the settings are correct, especially the following lines:$cfg[‘Servers’][$i][‘host’] = ‘localhost’; or ‘127.0.0.1’$cfg[‘Servers’][$i][‘port’] = ”; Leave empty for the default port or specify the correct port number $cfg[‘Servers’][$i][‘user’] = ‘root’; Your MySQL/MariaDB username $cfg[‘Servers’][$i][‘password’] = ”; Your
MySQL/MariaDB password
- Test your MySQL/MariaDB connection: Create a simple PHP file (e.g. “test_mysql.php“) in the document root directory of your web server and add the following code:
<?php$servername = “localhost”; $username = “root”; $password = “”; Your password MySQL/MariaDB // Create connection $conn = new mysqli($servername, $username, $password); Check the connection if ($conn->connect_error) { die(“Connection failed: ” . $conn->connect_error); } echo “Connected successfully”; ?>
Save the file and access it in your browser (e.g. http://localhost/test_mysql.php). If you see an error message, it may give you more information about the problem.
-
Check your firewall settings: If you have a firewall enabled, make sure you are not blocking the connection to the MySQL/MariaDB server. Add a rule to allow incoming connections to the MySQL/MariaDB port, which is typically 3306.
-
Reset MySQL/MariaDB root password: If you suspect that the problem is related to an incorrect root password, you can reset the password. The process varies depending on your operating system and MySQL/MariaDB installation. See the official documentation for instructions on how to reset the root password
: For MySQL: https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.htmlFor MariaDB:
https://mariadb.com/kb/en/resetting-the-root-password/
After trying these steps, if you are still experiencing connection errors, you may need to look for more specific error messages or check your web server, PHP or MySQL/MariaDB error logs for Learn more about the problem.
What are the most common errors and solutions when working on localhost with phpmyadmin?
When working with phpMyAdmin on localhost, you may encounter several common errors. Here are some of the most frequent problems and their respective solutions
:
-
Connection error: “Unable to connect: invalid configuration.” Workaround: Check the PMA script settings in the “config.inc.php” file, making sure that the correct host, user name, and password are specified. Also, check that your MySQL/MariaDB service is running.
-
“Access denied for user ‘root’@’localhost’ (using password: YES)” Solution: This error occurs when the user name or password is incorrect. Reset the root password for MySQL/MariaDB, or use the correct username and password when connecting.
-
“The mysqli extension is missing.” Workaround: Enable the mysqli extension in your PHP configuration file (php.ini). Locate the line “;extension=mysqli” and uncomment by removing the semicolon at the beginning. Save your changes and restart the web server.
-
“The mbstring extension is missing.” Workaround: Enable the mbstring extension in your PHP configuration file (php.ini). Locate the line “;extension=mbstring” and uncomment by removing the semicolon at the beginning. Save your changes and restart the web server.
-
“The mysqlnd extension is missing.” Workaround: Enable the mysqlnd extension in your PHP configuration file (php.ini). Locate the line “;extension=mysqlnd” and uncomment by removing the semicolon at the beginning. Save your changes and restart the web server.
-
“The requested URL /phpmyadmin was not found on this server.” Solution: Make sure you have copied the phpMyAdmin folder to the document root directory of your web server, such as “htdocs” for XAMPP, “www” for WAMP, and “htdocs” or “web” for MAMP/LAMP. Also, check your web server settings and make sure it is configured to serve files from the correct document root.
-
“Error: Token mismatch” solution: Clear your browser’s cache and cookies, and then try to sign in again. If the problem persists, check your PHP configuration for the “session.save_path” configuration and make sure it points to a valid, writable directory.
-
“Maximum execution time exceeded” or “memory_limit exceeded” solution: Increase the “max_execution_time” and “memory_limit” settings in your PHP configuration file (php.ini). For example, set “max_execution_time” to 300 (seconds) and “memory_limit” to 256M (256 megabytes). Save your changes and restart the web server.
Here are some of the most common errors you may encounter when working with phpMyAdmin on localhost. In general, carefully reading error messages and consulting relevant documentation will help you identify and resolve issues more effectively.
ValueWeb
Browser: Language: HTTP HOST: localhosts.mobiIP address: 172.71.210.246Referer: OK: Date: 2023/04/19 00:30:03