ຕິດຕັ້ງຖານຂໍ້ມູນ MariaDB ໃນ RHEL/CentOS/Fedora ແລະ Debian/Ubuntu
MariaDB ແມ່ນການທົດແທນທີ່ລົງໃນຖານສອງ ສຳ ລັບ MySQL, ຖືກພັດທະນາໂດຍຜູ້ຂຽນຕົ້ນສະບັບຂອງ MySQL ແລະ ເໝາະ ສົມກັບ MySQL ຢ່າງເຕັມທີ່ມີຄຸນສົມບັດເພີ່ມເຕີມແລະເພີ່ມປະສິດທິພາບທີ່ດີຂື້ນ ຈົນກ່ວາພວກເຮົາໄດ້ຂຽນຂໍ້ຄວາມນີ້, MariaDB 10.0 Series ແມ່ນຮຸ່ນການພັດທະນາ (Alpha) ແລະ MariaDB 5.5 ແມ່ນລຸ້ນປ່ອຍ (GA) ທີ່ມີຄວາມຫມັ້ນຄົງໃນປະຈຸບັນ.
ເປັນຫຍັງຂ້ອຍຄວນໃຊ້ MariaDB?
ດັ່ງທີ່ພວກເຮົາທຸກຄົນຮູ້ວ່າ MySQL ຖືກ ນຳ ໃຊ້ຢ່າງກວ້າງຂວາງແລະ RDBMS ທີ່ນິຍົມທີ່ສຸດແລະເປັນຕົວເລືອກ ທຳ ອິດຂອງນັກພັດທະນາ. ໃນປີ 2008, MySQL ຖືກຊື້ໂດຍ Sun Microsystem, ເຊິ່ງຕໍ່ມາໄດ້ຖືກຊື້ໂດຍ Oracle ແລະເຊິ່ງບໍ່ແມ່ນແຫຼ່ງເປີດອີກຕໍ່ໄປ.
ດີ, MariaDB ແມ່ນການສະ ໜັບ ສະ ໜູນ ໂດຍ Monty Program AB & MariaDB Foundation ແລະພັດທະນາຢ່າງເປັນອິດສະຫຼະໂດຍຜູ້ພັດທະນາຫຼັກຂອງ MySQL ແລະສະມາຊິກຊຸມຊົນອື່ນໆແລະເປັນແຫລ່ງເປີດທີ່ແທ້ຈິງ. ຜູ້ຊາຍທີ່ສ້າງຖານຂໍ້ມູນ MySQL ໂດຍ Michael "Monty" Widenius, David Axmark, ແລະ Allan Larsso ຜູ້ກໍ່ຕັ້ງ MySQL ແລະ Monty Program AB ແມ່ນຢູ່ເບື້ອງຫຼັງ MariaDB. ພວກເຂົາຈະເບິ່ງແຍງການພັດທະນາພື້ນຖານຂອງ MariaDB.
ຜູ້ທີ່ ກຳ ລັງໃຊ້ MariaDB?
ມີ ຈຳ ນວນການແຈກຈ່າຍ & ເວັບໄຊທ໌ໃຫຍ່ໄດ້ປ່ຽນມາເປັນ MariaDB, ບາງບ່ອນຄື:
<
ຕິດຕັ້ງຖານຂໍ້ມູນ MariaDB ໃນ RHEL/CentOS 6/5 ແລະ Fedora 18/17
ພວກເຮົາຂໍແນະ ນຳ ໃຫ້ໃຊ້ບ່ອນເກັບຮັກສາທີ່ ກຳ ນົດເອງ MariaDB YUM (Package Manager) ເພື່ອຕິດຕັ້ງ. ສ້າງແຟ້ມ repo ຢູ່ພາຍໃຕ້ /etc/yum.repos.d/MariaDB.repo, ຄັດລອກແລະໃສ່ລາຍການຕໍ່ໄປນີ້ຢູ່ພາຍໃຕ້ມັນ.
ໃນປະຈຸບັນ, ຫໍສະ ໝຸດ MariaDB ສາມາດໃຊ້ໄດ້ ສຳ ລັບ RHEL 6, RHEL5, CentOS 6, CentOS 5, ແລະ Fedora 20,19,18,17. ກະລຸນາເລືອກແລະເພີ່ມຖານຂໍ້ມູນທີ່ຖືກຕ້ອງໃສ່ໃນ OS OS ຂອງທ່ານ.
# 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
ເມື່ອທ່ານໄດ້ວາງແຟ້ມ MariaDB.repo ພາຍໃຕ້ /etc/yum.repos.d/. ໃຫ້ຕິດຕັ້ງດ້ວຍ ຄຳ ສັ່ງ 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
ຖ້າ, MariaDB GPG ເຊັນເຂົ້າລະຫັດບໍ່ໄດ້ຕິດຕັ້ງ, YUM ຈະຕິດຕັ້ງມັນໂດຍອັດຕະໂນມັດຫຼັງຈາກດາວໂຫລດທຸກໆຊຸດ.
ຫຼັງຈາກການຕິດຕັ້ງ ສຳ ເລັດແລ້ວ, ເລີ່ມຕົ້ນ MariaDB ດ້ວຍ ຄຳ ສັ່ງຕໍ່ໄປນີ້.
# 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
ພິມ ຄຳ ສັ່ງ ‘mysql’ ຢູ່ປາຍທາງ. ໂດຍລະຫັດຜ່ານເລີ່ມຕົ້ນ ສຳ ລັບຮາກແມ່ນຫວ່າງເປົ່າ.
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)]>
ດໍາເນີນການຄໍາສັ່ງຕໍ່ໄປນີ້ເພື່ອເບິ່ງຖານຂໍ້ມູນເລີ່ມຕົ້ນທີ່ມາພ້ອມກັບການຕິດຕັ້ງ.
MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | test | +--------------------+ 4 rows in set (0.00 sec)
ພິມ ອອກ ຈາກ ຄຳ ສັ່ງທີ່ຈະອອກຈາກຫອຍ.
MariaDB [(none)]> quit Bye
ຫຼັງການຕິດຕັ້ງ, ທ່ານຄວນອ່ານແລະຢູ່ລຸ່ມແຕ່ລະບາດກ້າວຢ່າງລະມັດລະວັງເຊິ່ງຈະຕັ້ງ ລະຫັດລັບລະຫັດຜ່ານ , ເອົາຜູ້ໃຊ້ບໍລິຈາກເງິນ , ບໍ່ໃຫ້ເຂົ້າສູ່ລະບົບຮາກຫ່າງໄກສອກຫຼີກ , ແລະ ເອົາຖານຂໍ້ມູນການທົດສອບແລະການເຂົ້າເຖິງ ເພື່ອຮັບປະກັນ 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!
ເມື່ອບົດຂຽນການຕິດຕັ້ງ ສຳ ເລັດແລ້ວ, ທ່ານ ຈຳ ເປັນຕ້ອງ Restart ຖານຂໍ້ມູນ MariaDB ເພື່ອເຮັດການປ່ຽນແປງ ໃໝ່.
# On RHEL/CentOS 6/5 and Fedora 19,18,17 # /etc/init.d/mysql restart # On Fedora 20 # systemctl restart mariadb.service
ຕັ້ງຄ່າ MariaDB ເພື່ອເລີ່ມຕົ້ນການໃສ່ເກີບ
chkconfig mysql on
ພະຍາຍາມເຊື່ອມຕໍ່ກັບຂໍ້ມູນຮາກຖານ ໃໝ່ ທີ່ ກຳ ນົດໄວ້ແລະພວກເຮົາຄວນຈະເຫັນບາງຢ່າງເຊັ່ນ.
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)]>
ຕິດຕັ້ງຖານຂໍ້ມູນ MariaDB ໃນ Debian 7/6 ແລະ Ubuntu 13.04/12/10/12.04
ພວກເຮົາຂໍແນະ ນຳ ໃຫ້ໃຊ້ຫໍໄຕທີ່ ກຳ ຫນົດເອງເພື່ອຕິດຕັ້ງ. ດໍາເນີນການຄໍາສັ່ງຕໍ່ໄປນີ້ເພື່ອເພີ່ມ MariaDB ໃນລະບົບຂອງທ່ານ. ກະລຸນາສັງເກດວ່າການເຊັນລະຫັດຈະຍັງຄືເກົ່າໃນ Debian ແລະ Ubuntu ໃນຂະນະທີ່ ນຳ ເຂົ້າຄືກັນ.
[email :~$ sudo apt-get install python-software-properties [email :~$ sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
ຄັດລອກແລະໃສ່ລາຍການຕໍ່ໄປນີ້ເຂົ້າໃນແຟ້ມເອກະສານ /etc/apt/sources.list ຢູ່ທາງລຸ່ມ.
# 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
ເມື່ອທ່ານ ນຳ ເຂົ້າລະຫັດທີ່ຖືກຕ້ອງແລະເພີ່ມຫໍສະມຸດຢ່າງຖືກຕ້ອງ, ທ່ານສາມາດຕິດຕັ້ງ MariaDB ດ້ວຍ ຄຳ ສັ່ງ apt-get ຕາມທີ່ສະແດງໄວ້. ໃນລະຫວ່າງການຕິດຕັ້ງທ່ານອາດຈະຂໍໃຫ້ຕັ້ງລະຫັດລັບ ສຳ ລັບຖານຂໍ້ມູນ.
[email :~$ sudo apt-get update [email :~$ sudo apt-get install mariadb-server
ເຂົ້າສູ່ລະບົບ MariaDB ດ້ວຍຂໍ້ມູນປະ ຈຳ ຕົວເຊິ່ງໄດ້ຕັ້ງໄວ້ກ່ອນ ໜ້າ ນີ້.
[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)
ໝາຍ ເຫດ: ພິມ ອອກ ຈາກ ຄຳ ສັ່ງເພື່ອອອກຈາກຖານຂໍ້ມູນ.
ລິ້ງອ້າງອີງ
<