Ịwụnye MariaDB 10.1 na Debian Jessie na-agba ọsọ dị iche iche MariaDB ajụjụ


N'edemede ikpeazụ anyị nwere ekele dị ukwuu Akụkọ Behind Nweta 'MySQL' na Rise of 'MariaDB'. N'isiokwu a, anyị atụleworị mkpa ọ dị ịkwanye MySQL, ịrị elu nke MariaDB, atụmatụ ya, nyocha nke MariaDB na MySQL, Mgbanwe nke ụfọdụ ụlọ ọrụ na ụlọ ọrụ ama ama (Google, Wikipedia) site na MySQL ruo MariaDB na ọtụtụ ndị ọzọ teknuzu na-abụghị oru akụkụ ya.

N'ebe a, anyị ga-etinye MariaDB 10.1 na Debian Jessie (Nnwale) ma ga-anwale ya site na ịmepụta obere tebụl na-agba ọsọ ọtụtụ ajụjụ na usoro mmụta na nghọta.

Wụnye MariaDB 10.1 na Debian Jessie

N'okpuru usoro Debian, a na-atụ aro ka ịwụnye 'python-software-properties'ngwugwu, tupu ịmalite maka nrụnye MariaDB site na ụlọ ọrụ gọọmentị.

# apt-get install python-software-properties

Na-esote, bubata ma debanye aha igodo GPG, nke na-enyere apt aka ịchọpụta izi ezi nke ngwanro ọ na-ebudata.

# apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db

Ugbu a, tinye ebe nchekwa ọrụ MariaDB na-esote faịlụ gị Source.list, na-eji iwu a.

# add-apt-repository 'deb http://mariadb.biz.net.id//repo/10.1/debian sid main'

Ọ bụrụ na ịgbakwunye ebe nchekwa na-atụfu njehie dị ka \add-apt-repository: achọghị iwu, ịkwesịrị itinye 'software-properties-common' dị ka egosiri n'okpuru.

# apt-get install software-properties-common

Melite ndepụta ngwugwu dị na sistemụ.

# apt-get update

N'ikpeazụ, wụnye MariaDB Server na Client, na-eji iwu ndị a.

# apt-get install mariadb-server mariadb-client

Ọ bụrụ na nrụnye na-aga nke ọma, lelee ụdị nke MariaDB arụnyere.

# mysql -V 

mysql  Ver 15.1 Distrib 5.5.38-MariaDB, for debian-linux-gnu (x86_64) using readline 5.1

Banye na MariaDB site na iji mgbọrọgwụ (anaghị akwado ya), paswọọdụ sochiri ya.

$ mysql -u root -p
Welcome to the MariaDB monitor.  Commands end with ; or \g. 
Your MariaDB connection id is 28 
Server version: 5.5.38-MariaDB-1 (Debian) 

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

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

MariaDB [(none)]>

IHE: 'Ọ dịghị onye' n'elu, ọ pụtara na ọ dịghị Database ahọpụtara ugbu a.

Na-agba ọsọ ajụjụ MariaDB dị iche iche

Otu esi emepụta onye ọrụ na MariaDB. Jiri syntax a ka imepụta onye ọrụ na MariaDB.

CREATE USER 'USER_NAME' IDENTIFIED BY 'PASSWORD';

Dịka ọmụmaatụ, iji mepụta onye ọrụ ''sam' na paswọọdụ ''sam123', anyị kwesịrị ime.

MariaDB [(none)]> CREATE USER 'sam' IDENTIFIED BY 'sam123'; 
Query OK, 0 rows affected (0.00 sec)

Ugbu a wepụ MariaDB wee banye n'iji onye ọrụ sam.

$ mysql -u 'sam' -p 
Enter password: 

Welcome to the MariaDB monitor.  Commands end with ; or \g. 
Your MariaDB connection id is 36 
Server version: 5.5.38-MariaDB-1 (Debian) 

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

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

MariaDB [(none)]>

Hichapụ/Wepụ MySQL onye ọrụ 'sam'.

MariaDB [(none)]> DROP USER sam; 
Query OK, 0 rows affected (0.00 sec)

Hụ ebe nchekwa data niile dị.

MariaDB [(none)]> SHOW DATABASES; 

+--------------------+ 
| Database           | 
+--------------------+ 
| information_schema | 
| mysql              | 
| performance_schema | 
+--------------------+ 
3 rows in set (0.04 sec)

IHE: Ebe nchekwa data niile gosiri n'elu bụ MariaDB n'ime. Edezila ọdụ data ndị a ọ gwụla ma ị ma ihe ị na-eme.

Họrọ nchekwa data site na listi (Ọ dị mkpa iji gbaa ajụjụ).

MariaDB [(none)]> USE mysql; 
Reading table information for completion of table and column names 
You can turn off this feature to get a quicker startup with -A 

Database changed 
MariaDB [mysql]>

Gosi tebụl niile dị n'ime database.

MariaDB [mysql]> SHOW TABLES; 

| Tables_in_mysql           | 
+---------------------------+ 
| columns_priv              | 
| db                        | 
| event                     | 
| func                      | 
| general_log               | 
| help_category             | 
| help_keyword              | 
| help_relation             | 
| help_topic                | 
.....
24 rows in set (0.00 sec)

Hụ kọlụm niile sitere na tebụl na-ekwu 'onye ọrụ' sitere na database 'mysql'. Jiri nke ọ bụla n'ime ajụjụ abụọ ahụ.

SHOW COLUMNS FROM user;

or 

DESCRIBE user;

Nsonaazụ nke ajụjụ abụọ ahụ bụ otu.

MariaDB [mysql]> describe user; 
+------------------------+-----------------------------------+------+-----+---------+-------+ 
| Field                  | Type                              | Null | Key | Default | Extra | 
+------------------------+-----------------------------------+------+-----+---------+-------+ 
| Host                   | char(60)                          | NO   | PRI |         |       | 
| User                   | char(16)                          | NO   | PRI |         |       | 
| Password               | char(41)                          | NO   |     |         |       | 
| Select_priv            | enum('N','Y')                     | NO   |     | N       |       | 
| Insert_priv            | enum('N','Y')                     | NO   |     | N       |       | 
| Update_priv            | enum('N','Y')                     | NO   |     | N       |       | 
| Delete_priv            | enum('N','Y')                     | NO   |     | N       |       | 
| Create_priv            | enum('N','Y')                     | NO   |     | N       |       | 
| Drop_priv              | enum('N','Y')                     | NO   |     | N       |       | 
.......
42 rows in set (0.01 sec)

Hụ nnukwu ozi ọkwa nkesa nke MariaDB.

MariaDB [mysql]> SHOW STATUS; 
+------------------------------------------+----------------------+ 
| Variable_name                            | Value                | 
+------------------------------------------+----------------------+ 
| Aborted_clients                          | 0                    | 
| Aborted_connects                         | 0                    | 
| Access_denied_errors                     | 0                    | 
| Aria_pagecache_blocks_not_flushed        | 0                    | 
| Aria_pagecache_blocks_unused             | 15737                | 
| Aria_pagecache_blocks_used               | 2                    | 
| Aria_pagecache_read_requests             | 176                  | 
| Aria_pagecache_reads                     | 4                    | 
| Aria_pagecache_write_requests            | 8                    | 
....
419 rows in set (0.00 sec)

Hụ nkwupụta MariaDB nke ejiri mepụta Database kwuo 'mysql'.

MariaDB [mysql]> SHOW CREATE DATABASE mysql; 
+----------+------------------------------------------------------------------+ 
| Database | Create Database                                                  | 
+----------+------------------------------------------------------------------+ 
| mysql    | CREATE DATABASE `mysql` /*!40100 DEFAULT CHARACTER SET latin1 */ | 
+----------+------------------------------------------------------------------+ 
1 row in set (0.00 sec)

Hụ nkwupụta MariaDB nke ejiri mepụta Tebụl sị 'onye ọrụ'.

MariaDB [mysql]> SHOW CREATE TABLE user; 
+ 
| Table | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
+-------
| user  | CREATE TABLE `user` ( 
  `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', 
  `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', 
  `Password` char(41) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', 
  `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', 
  `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', 
....

Hụ ikike nchekwa enyere onye ọrụ MariaDB niile.

MariaDB [mysql]> SHOW GRANTS; 
+----------------------------------------------------------------------------------------------------------------------------------------+ 
| Grants for [email                                                                                                               | 
+----------------------------------------------------------------------------------------------------------------------------------------+ 
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*698vsgfkemhvjh7txyD863DFF63A6bdfj8349659232234bs3bk5DC1412A' WITH GRANT OPTION | 
| GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION                                                                           | 
+----------------------------------------------------------------------------------------------------------------------------------------+ 
2 rows in set (0.00 sec)

Hụ ịdọ aka ná ntị nke sava MariaDB.

MariaDB [mysql]> SHOW WARNINGS; 
+--------------------------------------------------------------------------------------------------------------------------------------------------------------+ 
| Level | Code |Message                                                                                                                                                      | 
+-------+------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+ 
| Error | 1064 | You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ON mysql' at line 1 | 
+-------+------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+ 
1 row in set (0.00 sec)

Hụ mperi nke ozi MariaDB.

MariaDB [mysql]> SHOW ERRORS; 

+-------+------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+ 
| Level | Code | Message                                                                                                                                                      | 
+-------+------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+ 
| Error | 1064 | You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ON mysql' at line 1 | 
+-------+------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+ 
1 row in set (0.00 sec)

Nke ahụ bụ ihe niile maka Ugbu a. Nkwupụta 'SHOW' nwere ọtụtụ atụmatụ, nke anyị ga-atụle n'isiokwu n'ọdịnihu yana ajụjụ ndị ọzọ a ga-agba ọsọ na MariaDB iji nweta nsonaazụ achọrọ. Ruo mgbe ahụ nọrọ na nche wee jikọọ na Tecment. Echefula ịnye anyị nzaghachi gị bara uru na ngalaba nkọwa n'okpuru.