0% found this document useful (0 votes)
2 views10 pages

MariaDB Database Server (1)

The document provides an overview of MariaDB, an open-source relational database management system developed as a fork of MySQL. It includes instructions on setting up MariaDB, creating, altering, and deleting databases and tables, as well as best practices for database management. Key commands and syntax for database operations are also outlined.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views10 pages

MariaDB Database Server (1)

The document provides an overview of MariaDB, an open-source relational database management system developed as a fork of MySQL. It includes instructions on setting up MariaDB, creating, altering, and deleting databases and tables, as well as best practices for database management. Key commands and syntax for database operations are also outlined.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

MariaDB Database Server

Database Creation, Alteration, and Deletion


Introduction to MariaDB
Open-Source RDBMS Developed by MySQL Widely Used
Founders
Fork of MySQL Web, data warehousing, enterprise
Community-driven development
Setting Up MariaDB
Install via Package Manager
sudo apt install mariadb-server

Start and Enable Service


Systemctl commands

Access MariaDB
mysql -u root -p
Creating a Database
Syntax Example
CREATE DATABASE CREATE DATABASE
database_name; company_db;

Use Database
USE company_db;
Viewing Databases

List Databases Select Database


SHOW DATABASES; USE database_name;
Altering a Database
Character Set Renaming

ALTER DATABASE database_name CHARACTER SET Requires mysqldump workaround


utf8mb4 COLLATE utf8mb4_unicode_ci;
Creating a Table
CREATE TABLE employees (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(100),
department VARCHAR(50)
);

INSERT INTO employees (name, department) VALUES


('John Doe', 'HR');
Altering a Table
1 Add Column 2 Modify Column
ALTER TABLE employees ALTER TABLE employees
ADD COLUMN age INT; MODIFY COLUMN age
VARCHAR(10);

3 Drop Column
ALTER TABLE employees DROP COLUMN age;
Deleting a Database
DROP
1 Irreversible

DATABASE
2
Delete data

database_name
3
Specify name

DROP DATABASE company_db;

Warning: This action is irreversible.


Conclusion & Best Practices
Backups 1
Before modifying/deleting

2 Careful ALTER
Avoid unintended changes

Access Control 3
Database security

4 Monitor Performance
Regular optimization

You might also like