Databases are considerably easier to negociate from wrong a GUI. If you've migrated your servers from CentOS to Rocky Linux, you mightiness privation to instal phpMyAdmin. Jack Wallen shows you how.
If you're a database administrator, and you person to negociate either MySQL oregon MariaDB connected your information halfway servers, you cognize the payment of having a bully GUI to marque the task a spot much efficient. And if your servers person migrated from CentOS to Rocky Linux, you mightiness beryllium a spot disquieted astir getting specified a GUI up and running. Fret not. There's ever phpMyAdmin.
The occupation with phpMyAdmin is that the installation connected Rocky Linux (and astir RHEL clones) isn't astir arsenic straightforward arsenic it is with Ubuntu. But I'm going to assistance you retired with that. Once you've walked done this tutorial, you'll person phpMyAdmin up and moving successful minutes.
Are you ready?
SEE: Kubernetes: A cheat expanse (free PDF) (TechRepublic)
What you'll request
To get phpMyAdmin installed, you'll request a moving lawsuit of Rocky Linux and a idiosyncratic with sudo privileges. That's it. Let's get to work.
How to instal Apache and MySQL
Before you instal the web and database server, marque definite to update Rocky Linux with:
sudo dnf update -yAfter the update completes, reboot (if the kernel is updated) and past instal the webserver with:
sudo dnf instal httpd -yStart and alteration the webserver with:
sudo systemctl commencement httpd sudo systemctl alteration httpdNext, we request to let HTTP services done the firewall with the pursuing commands:
sudo firewall-cmd --permanent --zone=public --add-service=http sudo firewall-cmd --permanent --zone=public --add-service=https sudo firewall-cmd --reloadNow, we tin instal the database with:
sudo dnf instal mysql-server mysql -yStart and alteration MySQL:
sudo systemctl commencement mysqld sudo systemctl alteration mysqldSecure the database installation with:
mysql_secure_installationHow to instal PHP
We present request to instal PHP, which is done successful a overmuch antithetic mode than it is connected Ubuntu. First, let's reset the php module with:
sudo dnf module reset phpNow, we tin alteration PHP 7.4 with:
sudo dnf module alteration php:7.4Now we tin instal PHP and the assorted modules required for phpMyAdmin with:
sudo dnf instal php php-common php-opcache php-cli php-gd php-curl php-mysqlnd php-xml -yHow to download and unpack phpMyAdmin
Next, we'll download the phpMyAdmin record with the command:
wget https://files.phpmyadmin.net/phpMyAdmin/5.1.1/phpMyAdmin-5.1.1-all-languages.zipMake definite to cheque the official download page to guarantee you're downloading the astir caller version.
Unpack the record with:
unzip phpMyAdmin-*-all-languages.zipIf unzip isn't installed, instal it with:
sudo dnf instal unzip -yMove and rename the recently created directory with:
sudo mv phpMyAdmin-*-all-languages /usr/share/phpmyadminHow to configure phpMyAdmin
For our adjacent trick, we'll configure phpMyAdmin. Change into the phpmyadmin directory with:
cd /usr/share/phpmyadminCopy the illustration configuration record with the command:
sudo mv config.sample.inc.php config.inc.phpNow, we request to make a 32-bit concealed drawstring with:
openssl rand -base64 32Copy the resultant string.
Open the phpMyAdmin configuration record with the command:
sudo nano config.inc.phpIn that file, look for the line:
$cfg['blowfish_secret'] = '';Paste the 32-bit concealed drawstring betwixt the 2 azygous quotes.
Scroll down to the Directories for saving/loading files from sever conception and adhd the pursuing line:
$cfg['TempDir'] = '/tmp';Save and adjacent the file.
Create a caller tmp directory and springiness the everything the indispensable permissions/ownership with the pursuing commands:
sudo mkdir /usr/share/phpmyadmin/tmp sudo chown -R apache:apache /usr/share/phpmyadmin sudo chmod 777 /usr/share/phpmyadmin/tmpHow to make an Apache config record
Our adjacent measurement is to make an Apache config record with the command:
sudo nano /etc/httpd/conf.d/phpmyadmin.confIn that file, paste the following:
Alias /phpmyadmin /usr/share/phpmyadmin<Directory /usr/share/phpmyadmin/> AddDefaultCharset UTF-8 <IfModule mod_authz_core.c> # Apache 2.4 <RequireAny> Require each granted </RequireAny> </IfModule> </Directory> <Directory /usr/share/phpmyadmin/setup/> <IfModule mod_authz_core.c> # Apache 2.4 <RequireAny> Require each granted </RequireAny> </IfModule> </Directory>Save and adjacent the file.
How to acceptable the SELinux policies
In bid for SELinux to let postulation to the alternate determination (/usr/share/phpmyadmin), we request to marque it aware. To bash that, contented the command:
sudo chcon -Rv --type=httpd_sys_content_t /usr/share/phpmyadmin/*Restart Apache with the command:
sudo systemctl restart httpdHow to entree the phpMyAdmin web interface
Everything should present beryllium acceptable to go. Open a web browser and constituent it to http://SERVER/phpmyadmin (Where SERVER is the IP code of your hosting server) and you should beryllium prompted for the login credentials.
Congratulations, you've conscionable installed phpMyAdmin connected Rocky Linux, for easier MySQL database administration.
Data Center Trends Newsletter
DevOps, virtualization, the hybrid cloud, storage, and operational ratio are conscionable immoderate of the information halfway topics we'll highlight. Delivered Mondays and Wednesdays
Sign up todayAlso see
- How to instal Nextcloud 22 connected Ubuntu Server 20.04 (TechRepublic)
- How to specify DNS successful Docker containers (TechRepublic)
- How to go a database administrator: A cheat sheet (TechRepublic)
- Top 5 programming languages information admins should cognize (free PDF) (TechRepublic)
- 5 Linux server distributions you should beryllium using(TechRepublic Premium)
- DevOps: More must-read coverage (TechRepublic connected Flipboard)