Install MariaDB 10.6/10.5 on Fedora 35/34, CentOS Stream 8/RHEL 8.5/Rocky Linux 8.5 - Comment Page: 1
MariaDB is a binary drop in replacement for MySQL database server. This means that for most cases, you can just uninstall MySQL and install MariaDB and you are good to go.
Why MariaDB?
MariaDB is totally open source version of MySQL
It works just like MySQL and is compatible with MySQL setups
Fedora and Red Hat/CentOS/Rocky Linux use MariaDB instead of MySQL
[inttf_post_ad1]
This is guide, howto install or upgrade MariaDB 10.7.1 [RC], 10.6.3 [stable] or 10.5.13 [stable] on Fedora 35/34/33, CentOS Stream 8, Red Hat (RHEL) 8.5 and Rocky Linux 8.5. Installing MariaDB is almost same process than install MySQL.
Note: If you are moving from MySQL, then make sure that you backup...
Just today I started thinking I wanted to put MariaDB on my lamp stack, and started to look around for a guide. Low and behold, a solid guide was posted five days ago. Perfect timing. Thanks for the great guide.
Hi Brian,
Thanks and you are welcome! Nice to hear that you liked this guide!
Thank you very much for the info.
Greetings.
Thank you. I just upgraded to Fedora 19, and decided to replace mysql with MariaDB. I got mysql up so long ago I forgot the basic installation stuff, and wanted to interface Eclipse as soon as possible.
This was a very complete, short, set of steps.
i always tried to install mariadb or mysql, but when i enter this code:
“yum install mariadb mariadb-server”
or this:
“yum install mysql mysql-server”
i always get this error:
“Error: Cannot retrieve metalink for repository: fedora/19/i386. Please verify its path and try again”
anyone please help me. thank you
Hi Subkhan,
Could you post output of following commands:
His repo is not working currently as far as I can tell and also his repo link brings back blank page e.g. http://mariadb.if-not-true-then-false.com/fedora/ . MariaDB.repo file is blank.
Hi Josh,
MariaDB repo is official MariaDB repo. Address you point, should return empty page, but if you use exact command on EL5, EL6, F17, F18, F19, then you should get repo file content, try following on command line:
You should get url, like:
http://mariadb.if-not-true-then-false.com/fedora/19/x86_64/5
where you should find following content:
This is just helper script, which is much easier use (or at least explain) than MariaDB’s own repo generator. Biggest mistake on mariadb repo is directory naming, like:
http://yum.mariadb.org/5.5/fedora19-amd64
Which doesn’t make sense on Fedora or CentOS/RHEL. Paths should be compatible with $releasever, $arch and $basearch variables which are available on repo files.
thank you JR. definetly makes sense now.
I had trouble with the secure installation. It could not find /usr/bin/mysql.
This link:
https://downloads.mariadb.org/mariadb/repositories/#mirror=jmu&distro=CentOS
did a nice job of hooking me up with CentOS rpms that I could use with yum.
Not sure how this jives with what you said in your Dec 2 reply (Biggest mistake on mariadb repo is directory naming…) but it got me past the secure installation.
Love the site, it’s a def goto for my CentOS/Fedora configs. Thanks!
Hi Daniel,
This uses exactly same repo, MariaDB original repo. And when you use step 2. commands to get repo file, it’s same what you get using their browser based repo file generator. If you wonder why to use wget instead browser, you see the point, if you have to do it thousand times on different servers. :) If you want use MariaDB repo generator, it’s totally okay and result is same and you can still use this guide to install it.
Autostart MySQL on boot (Fedora 20):
sudo systemctl enable mariadb.service
Hi Mojtaba,
Both works:
mysqld.service is symbolic link to mariadb.service.
Hi JR,
Thank you JR.
Symbolic link:
ls -l /usr/lib/systemd/system/{mysqld.service,mariadb.service}
-rw-r--r--. 1 root root 1695 Nov 27 17:56 /usr/lib/systemd/system/mariadb.service
lrwxrwxrwx. 1 root root 15 Jan 4 11:58 /usr/lib/systemd/system/mysqld.service -> mariadb.service
But when enable mysqld.service:
# mysqld.service not work(only for "ENABLE" service)
systemctl enable mysqld.service
Failed to issue method call: No such file or directory
mysql -V
mysql Ver 15.1 Distrib 5.5.34-MariaDB, for Linux (x86_64) using readline 5.1
uname -srp
Linux 3.12.6-300.fc20.x86_64 x86_64
I don’t even know why I bother going to any other website for guides. You guys post the best guides and they just WORK. Thank you very much.
JR,
Thanks for your help and you are very knowledgeable, I really appreciate and proud of you all the hard work you are doing!!! KUDOS TO YOU!!!
My end goal is to use PHP to query results on my WEB browser.
So, I run a small script to test my connection to my MySQL/MariaDB database.
When I run the php file on my browser localhost/file.php
All I get is a BLANK white page. Any suggestions what I am doing wrong?
Any help is greatly appreciated.
[code]
[/code]
username can be either ROOT or the one that is used to login into the desktop first. either should work.
Any help is greatly appreciated.
My code did not show up in the above comment. sorry. it should look something like this.
$hostname = “localhost”;
$username = “root”;
$password = “password”;
// Create connection to the database
$dbhandle = mysql_connect($hostname, $username, $password);
or die (“unable to connect to MySQL”);
echo “connected to MySQL”;
?>
Hi amir,
Could you check your web server access and error logs, is there any errors?
I am not sure what I am looking for?
is it under /var/logs/httpd ???
which log file I should be looking at?
under httpd there is access_log or error_log file?
Hi amir,
Yes, you find right place and both access_log and error_log are interesting. You can post both content here or example http://pastebin.com
JR,
Do you have a guide for installing SENDMAIL or POSTFIX for FEDORA 20.
I am very frustrated right now. I have working for 2 weeks straight to get POSTFIX working my FEDORA 20 server. I think my ISP is blocking port 25, Any way to get around that. I have heard something about relaying SMTP?
Any help is greatly appreciated.
Hi, i’m having some trouble in here with fedora 20.
http://pastebin.com/D6evtciS
could you help me?