Mariadb 简明教程
MariaDB - Introduction
数据库应用程序独立于主应用程序而存在,并存储数据集合。每个数据库都使用一个或多个 API 来创建、访问、管理、搜索和复制它包含的数据。
A database application exists separate from the main application and stores data collections. Every database employs one or multiple APIs for the creation, access, management, search, and replication of the data it contains.
数据库还使用非关系数据源,如对象或文件。但是,对于大型数据集而言,数据库被证明是最佳选择,而使用其他数据源会使检索和写入变得缓慢。
Databases also use non-relational data sources such as objects or files. However, databases prove the best option for large datasets, which would suffer from slow retrieval and writing with other data sources.
关系数据库管理系统或 RDBMS 将数据存储在不同的表中。通过使用主键和外键建立这些表之间的关系。
Relational database management systems, or RDBMS, store data in various tables.Relationships between these tables are established using primary keys and foreign keys.
RDBMS 提供以下功能
RDBMS offers the following features −
-
They enable you to implement a data source with tables, columns, and indices.
-
They ensure the integrity of references across rows of multiple tables.
-
They automatically update indices.
-
They interpret SQL queries and operations in manipulating or sourcing data from tables.
RDBMS Terminology
在我们开始讨论 MariaDB 之前,让我们回顾一下与数据库相关的一些术语。
Before we begin our discussion of MariaDB, let us review a few terms related to databases.
-
Database − A database is a data source consisting of tables holding related data.
-
Table − A table, meaning a spreadsheet, is a matrix containing data.
-
Column − A column, meaning data element, is a structure holding data of one type; for example, shipping dates.
-
Row − A row is a structure grouping related data; for example, data for a customer. It is also known as a tuple, entry, or record.
-
Redundancy − This term refers to storing data twice in order to accelerate the system.
-
Primary Key − This refers to a unique, identifying value. This value cannot appear twice within a table, and there is only one row associated with it.
-
Foreign Key − A foreign key serves as a link between two tables.
-
Compound Key − A compound key, or composite key, is a key that refers to multiple columns. It refers to multiple columns due to a column lacking a unique quality.
-
Index − An index is virtually identical to the index of a book.
-
Referential Integrity − This term refers to ensuring all foreign key values point to existing rows.
MariaDB Database
MariaDB 是由 MySQL 的原开发者创建的 MySQL 一个流行的分支。它源自对甲骨文收购 MySQL 的担忧。它为小型数据处理任务和企业需求提供支持。它旨在作为 MySQL 的模块化替代品,只需卸载 MySQL 并安装 MariaDB。MariaDB 提供了与 MySQL 相同的功能,并提供了更多功能。
MariaDB is a popular fork of MySQL created by MySQL’s original developers. It grew out of concerns related to MySQL’s acquisition by Oracle. It offers support for both small data processing tasks and enterprise needs. It aims to be a drop-in replacement for MySQL requiring only a simple uninstall of MySQL and an install of MariaDB. MariaDB offers the same features of MySQL and much more.
Key Features of MariaDB
MariaDB 的重要功能包括:
The important features of MariaDB are −
-
All of MariaDB is under GPL, LGPL, or BSD.
-
MariaDB includes a wide selection of storage engines, including high-performance storage engines, for working with other RDBMS data sources.
-
MariaDB uses a standard and popular querying language.
-
MariaDB runs on a number of operating systems and supports a wide variety of programming languages.
-
MariaDB offers support for PHP, one of the most popular web development languages.
-
MariaDB offers Galera cluster technology.
-
MariaDB also offers many operations and commands unavailable in MySQL, and eliminates/replaces features impacting performance negatively.
Getting Started
在开始本教程之前,请确保你已经具备了 PHP 和 HTML 的一些基本知识,特别是我们 PHP 和 HTML 教程中讨论的内容。
Before you begin this tutorial, make sure you have some basic knowledge of PHP and HTML, specifically material discussed in our PHP and HTML tutorials.
本指南重点介绍了在 PHP 环境中使用 MariaDB,因此我们的示例将对 PHP 开发人员最有用。
This guide focuses on use of MariaDB in a PHP environment, so our examples will be most useful for PHP developers.
如果你不熟悉或需要查看,我们强烈建议你查看我们的 PHP 教程。
We strongly recommend reviewing our PHP Tutorial if you lack familiarity or need to review.