phpMyAdmin is a free and open-source web-based tool written in PHP that allows users to manage MySQL or MariaDB databases through a web browser. It provides a graphical interface to perform various database administration tasks such as creating, modifying, and deleting databases, tables, fields, and rows. Additionally, phpMyAdmin enables users to execute SQL queries, import and export data, manage user permissions, and more, making it a popular choice for database management among developers and website administrators.
To install phpMyAdmin on Linux follow these general steps.
Update Package Lists
First, update the package lists to ensure you’re getting the latest versions of the software.
sudo apt update
Install phpMyAdmin
During the installation process, you’ll be prompted to configure phpMyAdmin.
sudo apt install phpmyadmin
Credentials
During the configuration process, you’ll be prompted to provide authentication details. Use MariaDB credentials.
Create a new user
Create a separate MariaDB user for phpMyAdmin. Replace your_password
with the password you want to use.
CREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'your_password';
GRANT SELECT, INSERT, UPDATE, DELETE ON `phpmyadmin`.* TO 'phpmyadmin'@'localhost';
GRANT SELECT ON `phpmyadmin`.* TO 'phpmyadmin'@'localhost';
FLUSH PRIVILEGES;
Possible issue
If the previous statements don’t work, try this.
GRANT ALL PRIVILEGES ON `phpmyadmin`.* TO 'phpmyadmin'@'localhost';
FLUSH PRIVILEGES;
Configuration
Verify the location of the configuration files.
ls /etc/phpmyadmin/apache.conf
If the configuration file is located at /etc/phpmyadmin/apache.conf, you can create a symbolic link to enable it in Apache. Creating a symbolic link is a common way to enable configuration files in Apache without directly modifying the main Apache configuration files.
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-enabled/phpmyadmin.conf
If the configuration file for phpMyAdmin is not located at /etc/phpmyadmin/apache.conf
, you would need to locate the actual configuration file and then create a symbolic link to enable it in Apache.
Example of search
find /etc -name "apache.conf"
Enable the phpMyAdmin configuration file
After running the following command, Apache will automatically include the phpMyAdmin configuration settings when it starts or reloads, ensuring that phpMyAdmin is configured and accessible through your web server.
sudo a2enconf phpmyadmin
Enabling the phpMyAdmin configuration file lets Apache include phpMyAdmin configuration settings when it starts or reloads.
Restart Apache
sudo service apache2 restart
Run phpMyAdmin
Open your web browser and enter the following text into the address bar.
http://localhost/phpmyadmin/
Conclusion
By following these steps, phpMyAdmin will be configured to use your MariaDB credentials for authentication, allowing you to manage your MariaDB databases using phpMyAdmin with ease.