Fi aaye data MariaDB sii ni RHEL/CentOS/Fedora ati Debian/Ubuntu


MariaDB jẹ rirọpo silẹ-ni alakomeji fun MySQL, ti dagbasoke nipasẹ awọn onkọwe atilẹba ti Project MySQL ati ibaramu ni kikun pẹlu MySQL nini awọn ẹya diẹ sii ati imudarasi iṣẹ to dara julọ. Titi a yoo fi kọ ifiweranṣẹ yii, MariaDB 10.0 Jara jẹ ẹya idagbasoke (Alpha) ati MariaDB 5.5 jẹ idasilẹ iduroṣinṣin lọwọlọwọ (GA).

Kini idi ti Mo le lo MariaDB?

Bi gbogbo wa ṣe mọ MySQL ni lilo kariaye ati RDBMS ti o gbajumọ julọ ati yiyan akọkọ ti awọn olupilẹṣẹ. Ni ọdun 2008, MySQL gba nipasẹ Sun Microsystem, eyiti Oracle ti ra lẹhinna ati eyiti kii ṣe orisun ṣiṣi mọ.

O dara, MariaDB jẹ onigbọwọ nipasẹ Monty Program AB & MariaDB Foundation ati pe o dagbasoke ni ominira nipasẹ olugbala pataki ti MySQL ati awọn ọmọ ẹgbẹ agbegbe miiran ati orisun ṣiṣi ni otitọ. Ọkunrin ti o ṣẹda ibi ipamọ data MySQL nipasẹ Michael "Monty" Widenius, David Axmark, ati Allan Larsso oludasile MySQL ati Monty Program AB wa ni bayi lẹhin MariaDB. Wọn yoo ṣe abojuto idagbasoke ti ipilẹ MariaDB.

Tani o nlo MariaDB?

Nọmba awọn pinpin kaakiri & awọn oju opo wẹẹbu nla ti yipada si MariaDB, diẹ ninu wọn ni:

  1. Ile-iṣẹ Mozilla
  2. Wikipedia
  3. OpenSuse
  4. Fedora
  5. OLX
  6. Nimbuzz
  7. SlashGear
  8. ArchLinux
  9. Redli Idawọlẹ Redhat (lati RHEL7)
  10. Slackware
  11. Mageia
  12. Slackware
  13. TurboLinux
  14. Iṣẹ akanṣe Chakra
  15. Gentoo
  16. GNU/Linux KDu

Fifi aaye data MariaDB sii ni RHEL/CentOS 6/5 ati Fedora 18/17

A ṣe iṣeduro gíga lati lo aṣa ibi ipamọ MariaDB YUM (Oluṣakoso Package) lati fi sii. Ṣẹda faili repo kan labẹ /etc/yum.repos.d/MariaDB.repo, Daakọ ati lẹẹ mọ awọn titẹ sii atẹle labẹ rẹ.

Lọwọlọwọ, awọn ibi ipamọ MariaDB wa fun RHEL 6, RHEL5, CentOS 6, CentOS 5, ati Fedora 20,19,18,17. Jọwọ yan ki o ṣafikun ibi ipamọ ti o tọ si ẹya OS rẹ.

# MariaDB 5.5 RedHat repository list - created 2013-08-11 14:29 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/rhel6-x86
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
# MariaDB 5.5 RedHat repository list - created 2013-08-11 14:30 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/rhel6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
# MariaDB 5.5 RedHat repository list - created 2013-08-11 14:31 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/rhel5-x86
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
# MariaDB 5.5 RedHat repository list - created 2013-08-11 14:31 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/rhel5-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
# MariaDB 5.5 CentOS repository list - created 2013-08-11 14:21 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos6-x86
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
# MariaDB 5.5 CentOS repository list - created 2013-08-11 14:22 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
# MariaDB 5.5 CentOS repository list - created 2013-08-11 14:23 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos5-x86
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
# MariaDB 5.5 CentOS repository list - created 2013-08-11 14:23 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos5-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
# MariaDB 5.5 Fedora repository list - created 2014-03-19 06:34 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/fedora20-x86
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
# MariaDB 5.5 Fedora repository list - created 2014-03-19 06:35 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/fedora20-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
# MariaDB 5.5 Fedora repository list - created 2014-03-19 06:31 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/fedora19-x86
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
# MariaDB 5.5 Fedora repository list - created 2014-03-19 06:34 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/fedora19-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
# MariaDB 5.5 Fedora repository list - created 2013-08-11 14:32 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/fedora18-x86
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
# MariaDB 5.5 Fedora repository list - created 2013-08-11 14:33 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/fedora18-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
# MariaDB 5.5 Fedora repository list - created 2013-08-11 14:33 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/fedora17-x86
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
# MariaDB 5.5 Fedora repository list - created 2013-08-11 14:33 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/fedora17-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Lọgan ti o ti gbe faili MariaDB.repo labẹ /etc/yum.repos.d/. Jẹ ki a fi sori ẹrọ pẹlu atẹle aṣẹ YUM.

# On RHEL/CentOS 6/5 and Fedora 19,18,17 #
 yum -y install MariaDB MariaDB-server

# On Fedora 20 #
 yum -y install mariadb mariadb-server

Ti, Koko-ọrọ Ibuwọlu MariaDB GPG ti ko fi sii, YUM yoo fi sii laifọwọyi lẹhin igbasilẹ gbogbo awọn idii.

Lẹhin fifi sori ẹrọ pari, bẹrẹ MariaDB pẹlu aṣẹ atẹle.

# On RHEL/CentOS 6/5 and Fedora 19,18,17 #
 /etc/init.d/mysql start

# On Fedora 20 #
 systemctl start mariadb.service 
 systemctl enable mariadb.service

Tẹ aṣẹ 'MySQL' ni ebute naa. Nipa ọrọigbaniwọle aiyipada fun gbongbo ṣofo.

 mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 1
Server version: 5.5.32-MariaDB MariaDB Server

Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

Ṣiṣe aṣẹ atẹle lati wo awọn apoti isura data aiyipada ti o wa pẹlu fifi sori ẹrọ.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)

Tẹ olodun lati aṣẹ pipaṣẹ lati jade kuro ni ikarahun.

MariaDB [(none)]> quit
Bye

Fifi sori ifiweranṣẹ, o yẹ ki o ka ati ni isalẹ awọn igbesẹ kọọkan ni pẹkipẹki eyi ti yoo ṣeto ọrọ igbaniwọle root , yọ awọn olumulo alailorukọ kuro , ko gba wiwọle wọle latọna jijin , ati yọ ibi ipamọ data idanwo ati iraye si lati ni aabo MariaDB.

  mysql_secure_installation
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):

OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] Y

New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

Lọgan ti iwe afọwọkọ fifiranṣẹ pari, o nilo lati Tun bẹrẹ ibi ipamọ data MariaDB lati mu awọn ayipada tuntun.

# On RHEL/CentOS 6/5 and Fedora 19,18,17 #
 /etc/init.d/mysql restart

# On Fedora 20 #
 systemctl restart mariadb.service 

Ṣeto MariaDB lati bẹrẹ lori bata

 chkconfig mysql on

Jẹ ki a gbiyanju lati sopọ pẹlu ijẹrisi gbongbo tuntun ti a ṣeto ati pe o yẹ ki a rii nkan bi.

 mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 1
Server version: 5.5.32-MariaDB MariaDB Server

Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

Fifi sori aaye data MariaDB ni Debian 7/6 ati Ubuntu 13.04/12/10/12.04

A ṣe iṣeduro gíga lati lo ibi ipamọ aṣa lati fi sori ẹrọ. Ṣiṣe awọn ofin wọnyi lati ṣafikun MariaDB si eto rẹ. Jọwọ ṣe akiyesi bọtini iforukọsilẹ yoo wa kanna ni Debian ati Ubuntu lakoko gbigbe wọle kanna.

[email :~$ sudo apt-get install python-software-properties
[email :~$ sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db

Daakọ ati lẹẹ awọn titẹ sii wọnyi sinu faili kan /etc/apt/sources.list ni isale.

# MariaDB 5.5 repository list - created 2013-08-11 15:03 UTC
# http://mariadb.org/mariadb/repositories/
deb http://mirrors.scie.in/mariadb/repo/5.5/debian wheezy main
deb-src http://mirrors.scie.in/mariadb/repo/5.5/debian wheezy main
# MariaDB 5.5 repository list - created 2013-08-11 15:17 UTC
# http://mariadb.org/mariadb/repositories/
deb http://mirrors.scie.in/mariadb/repo/5.5/debian squeeze main
deb-src http://mirrors.scie.in/mariadb/repo/5.5/debian squeeze main
# MariaDB 5.5 repository list - created 2014-03-19 06:47 UTC
# http://mariadb.org/mariadb/repositories/
deb http://mirrors.scie.in/mariadb/repo/5.5/ubuntu saucy main
deb-src http://mirrors.scie.in/mariadb/repo/5.5/ubuntu saucy main
# MariaDB 5.5 repository list - created 2013-08-11 15:18 UTC
# http://mariadb.org/mariadb/repositories/
deb http://mirrors.scie.in/mariadb/repo/5.5/ubuntu raring main
deb-src http://mirrors.scie.in/mariadb/repo/5.5/ubuntu raring main
# MariaDB 5.5 repository list - created 2013-08-11 15:24 UTC
# http://mariadb.org/mariadb/repositories/
deb http://mirrors.scie.in/mariadb/repo/5.5/ubuntu quantal main
deb-src http://mirrors.scie.in/mariadb/repo/5.5/ubuntu quantal main
# MariaDB 5.5 repository list - created 2013-08-11 15:24 UTC
# http://mariadb.org/mariadb/repositories/
deb http://mirrors.scie.in/mariadb/repo/5.5/ubuntu precise main
deb-src http://mirrors.scie.in/mariadb/repo/5.5/ubuntu precise main

Lọgan ti o ba ti bọtini ti o wọle wọle daradara ti o fi kun ibi ipamọ daradara, o le fi MariaDB sii pẹlu aṣẹ-gba aṣẹ bi o ti han. Lakoko fifi sori o le beere lati ṣeto ọrọigbaniwọle gbongbo fun ibi ipamọ data.

[email :~$ sudo apt-get update
[email :~$ sudo apt-get install mariadb-server

Wọle MariaDB pẹlu ijẹrisi gbongbo eyiti a ṣeto tẹlẹ.

[email :~$ sudo mysql -u root -p
[sudo] password for narad: 
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 42
Server version: 10.0.3-MariaDB-1~raring-log mariadb.org binary distribution

Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>
MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)

Akiyesi: Tẹ olodun lati aṣẹ aṣẹ lati jade kuro ni ibi ipamọ data.

Itọkasi Awọn ọna asopọ

  1. MariaDB Vs MySQL - Awọn ẹya
  2. Iwe MariaDB
  3. oju-iwe MariaDB oju-iwe