MariaDB לש תונוש תותליאש תלעפהו יס'ג ןאיבדב MariaDB 10.1 תנקתה


.רחא ינכט אלו ינכט טביה הברה דועו MariaDB -ל MySQL -מ (הידפיקיו ,לגוג) םלועב םיעדונה תורבחהו םידיגאתהמ המכ לש רבעמ ,MySQL -ו MariaDB לע יתאוושה רקחמ ,ויתונוכת ,MariaDB תיילע ,MySQL תא גלזמ

.הנבהו הדימל ךילהתב תותליאש רפסמ תלעפהו תונטק תואלבט תריצי ידי לע תאז קודבנו (הקידב) יס'ג ןאיבד לע MariaDB 10.1 תא ןיקתהל םינווכתמ ונא ןאכ

Debian Jessie -ב MariaDB 10.1 תא ןקתה

.םיימשר םירגאממ MariaDB לש הנקתהל ךישמתש ינפל ' תונוכת-תונוכת-ןותייפ ' הליבחה תא ןיקתהל דואמ ץלמומ ,ןאיבד תוכרעמב

# apt-get install python-software-properties

.דירומ אוהש תונכותה תוניקת תא תמאל apt ל רשפאמה ,GPG חתפמ לש שדחמ םושירו אביי ,ןכמ רחאל

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

.האבה הדוקפה תועצמאב sources.list ץבוקל MariaDB לש ימשרה רגאמה תא ףסוה תעכ

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

.ןלהל גצומכ 'תופתושמ תונוכת-תונוכת' ןיקתהל ךילע ," האצמנ אל הדוקפה :b> add-apt-repository>"\ומכ האיגש האיבמ רגאמ תפסוה םא

# apt-get install software-properties-common

.תכרעמב תונימזה תוליבחה תמישר תא ןכדע

# apt-get update

.תואבה תודוקפה תועצמאב MariaDB Server and Client תא ןקתה ,ףוסבל

# apt-get install mariadb-server mariadb-client

.תנקתומה MariaDB לש הסרגה תא קודב ,קלח תרבוע הנקתהה םא

# mysql -V 

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

.המסיס וירחאו ,(ץלמומ אל) root תועצמאב MariaDB -ל רבחתה

$ 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)]>

.עגרכ םינותנ דסמ רחבנ אלש רבדה שוריפ ,ליעל 'דחא ףא' :הרעה

MariaDB לש תונוש תותליאש תלעפה

.MariaDB -ב שמתשמ רוציל ידכ אבה ריבחתב שמתשה .MariaDB -ב שמתשמ רוציל דציכ

CREATE USER 'USER_NAME' IDENTIFIED BY 'PASSWORD';

.עצבל ונילע ,' sam123 ' המסיס םע ' sam ' שמתשמ רוציל ידכ ,המגודל

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

. םס שמתשמה תועצמאב רבחתהו DB הירמ אצ תעכ

$ 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)]>

.MySQL שמתשמ 'םס' ררחש/קחמ

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

.ןימזה םינותנה דסמ לכ תא האר

MariaDB [(none)]> SHOW DATABASES; 

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

.השוע התא המ עדוי התא ןכ םא אלא הלא עדימ ירגאמ ךורעת לא .ימינפ ןפואב MariaDB תא םישמשמ ליעל םיגצומה עדימה ירגאמ לכ :הרעה

.(תותליאש תלעפהל יחרכה) המישרהמ םינותנ דסמ רחב

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]>

.םינותנה דסמב תואלבטה לכ תא הארה

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)

.תוליאשה יתשמ תחאב שמתשה .'mysql' םינותנה דסממ 'שמתשמ' רמואש הלבטהמ תודומעה לכ תא האר

SHOW COLUMNS FROM user;

or 

DESCRIBE user;

.ההז תותליאשה יתש לש האצותה

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)

.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)

.'mysql' רומא םינותנ דסמ תריציל השמישש MariaDB תרהצה תא האר

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)

.'שמתשמ' תרמוא הלבט תריציל השמישש MariaDB תרהצה תא האר

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', 
....

.MariaDB לכ/שמתשמל תוקנעומה החטבאה תויוכז תא האר

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)

.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)

.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)

.הטמל תובוגתה ףיעסב ךלש רקיה בושמה תא ונל קפסל חכשת לא .טנימקטל רבוחמו ןווכמ ראשיה זא דע .היוצרה האצותה תא גישהל ידכ MariaDB לע ולעפויש תורחא תותליאש םע דחי ידיתעה רמאמב ןודנ ןהילע ,תונוכת


כל הזכויות שמורות. © Linux-Console.net • 2019-2024