How to install MariaDB or MySql on Ubuntu or Debian Linux
1. Install MariaDB Server:
apt install mariadb-server
apt install mariadb-client
2. After installing MariaDB, the commands below can be used to stop, start and enable MariaDB service to always start up when the server boots.
systemctl stop mariadb.service
systemctl start mariadb.service
systemctl enable mariadb.service
3. Run the commands below to secure MariaDB server by creating a root password
mysql_secure_installation
4. Answer the questions below by following the guide
If you've just installed MariaDB, and haven't set the root password yet, you should just press enter here. Enter current password for root (enter for none): PRESS ENTER Switch to unix_socket authentication [Y/n] n Change the root password? [Y/n] n Remove anonymous users? [Y/n] y Disallow root login remotely? [Y/n] y Remove test database and access to it? [Y/n] y Reload privilege tables now? [Y/n] y All done!
5. Run the commands below to logon to MariaDB server.
mysql -u root -p
6. Create a new user for phpMyAdmin to use to connect to the database.
CREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'very_strong_password_here';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost' WITH GRANT OPTION;
How to install PHP on Ubuntu or Debian Linux
1. To a third party repository with the latest versions of PHP, run the commands below.
apt-get install software-properties-common
add-apt-repository ppa:ondrej/php
apt update
2. Install PHP
apt install php8.0 php8.0-common php8.0-mysql php8.0-gmp php8.0-curl php8.0-intl php8.0-mbstring php8.0-xmlrpc php8.0-gd php8.0-xml php8.0-cli php8.0-zip
How to install phpmyadmin on Ubuntu or Debian Linux
1. apt install phpmyadmin
+------------------------+ Configuring phpmyadmin +------------------------+ | Please choose the web server that should be automatically configured to | | Web server to reconfigure automatically: | | | | [*] apache2 | | [ ] lighttpd | | | +-------------------------------------------------------------------------+
2.
+------------------------+ Configuring phpmyadmin +-------------------------+ | | | The phpmyadmin package must have a database installed and configured | | before it can be used. This can be optionally handled with | | dbconfig-common. | | | | If you are an advanced database administrator and know that you want to | | perform this configuration manually, or if your database has already | | been installed and configured, you should refuse this option. Details | | on what needs to be done should most likely be provided in | | /usr/share/doc/phpmyadmin. | | | | Otherwise, you should probably choose this option. | | | | Configure database for phpmyadmin with dbconfig-common? | | | | | | | +---------------------------------------------------------------------------+
3. http://localhost/phpmyadmin
4. make sure file phpmyadmin.conf exists in /etc/apache2/conf-enabled/