database Flashcards

1
Q

basic database structure

A
Basic structure (tables, fields, entries)
 The table is the core structure of a relational database.  Tables are made up of fields (columns) and entries (rows).  Each table should represent a type of object (eg. a table for pets).  Each field should represent a trait or descriptor of the object represented by the table (eg. the pets table might have fields for animal type and neutered state). Each entry represents one instance of the object.  (eg. each entry is one pet).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

relational database

A

This is a course about database management. But what is a database? A database is a structured set of data. The structure can be anything, but the most common form of database is a relational database. A relational database is a database made up of tables, where each row in the table has a unique key.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

database engines

A

There are two storage engines for MySQL/MariaDB commonly used on cPanel servers: InnoDB and MyISAM. MyISAM was the default until MySQL 5.5.5, when InnoDB became the default. MyISAM is faster, and has the benefit of being portable (moving the files moves the database), but InnoDB has more advanced features.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

indexes and queries

A

MySQL uses indexes for both InnoDB and MyISAM tables. An index is a special data structure that makes lookups on large tables faster. A query is when you ask the database to find some information for you. Queries for MySQL/MariaDB are made in Structure Query Language (usually seen as SQL). SQL is used by many database engines.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

grants

A

Since databases are used by many users who shouldn’t necessarily have access to each others data, MySQL/MariaDB has mechanisms in place to prevent the unauthorized reading and writing of data. This is done with “grants”, which grant specific privileges on a specific table to a specific user on a specific host. There are many types of grants, for the different types of operations that can be performed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

config files

A

/etc/my.cnf

/root/.my.cnf

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

where the database mapping is stored
review what database mapping is again
reference the WHM db mapping tool

A

/var/cpanel/databases

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

where temporary files used for large queries go

required for innodb to start

A

/tmp

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

database files themselves
directories for databases
innodb files - ibdata, ibd (data), tablespaces
myisam files - MYD (data), MYI (index), and frm (format)

A

/var/lib/mysql

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Let’s find all the databases that start with “animals” on this server:

A

show databases like “animals%”;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly