4-Maria DBMS
4-Maria DBMS
Database types:
-SQL DB (DBMS) composed of TABLE (ROWS and COLUMN). In tables , a
row represents a records, In a record, a column represents an attribute of that
record, Not Scalable (fixed size for field), MYSQL, MariaDB and PostgreSQL.
-NO SQL do not depends on tables (ELK Stack) log management solution, Mongo
DB.
-MYSQL is Sun micro systems
-MYSQL in RHEL6, enabled Clustering, can have web interface for easy
management, can be installed in windows
-Mariadb is opensource developed by developers and compatible with MYSQL
and works with RHEL7.
To connect to the database securely we must use the installation script, to avoid
man in the middle attack.
Note: In mysql or mariadb, the user accounts is database account not files system
account, so maybe we have database account in mariadb that is not in the current
file system.
Note: Every command written in mysql or Mariadb must ended with semi-column
(;), it you need to have help we use\h or to clear the input we use \c.
Note: to differentiate between the command and any attribute or database or table
or value, it is recommended to write the command in uppercase.
Here is the information inside the table user, this information is shown in rows. If
we want to show only three fields from the user table.
To create database:
User:tarek
Machine: any
Password:iti@123
Note: by default the users that is created by default the do not have any privileges
to do anything.
To add privileges:
Means allow tarek to login form either localhost or the FQDN Name to have
access on the database students on all tables.
Username: tarek
Machine name to connect to database: server.lab.local
Password for tarek: iti@123
NOTE: tarek is DBMS user account not Linux OS Account
[(none)]: means it is not connected to any database now
Where:
All means: SELECT, CREATE, INSERT, ALTER , DROP, UPDATE.
*.*: the database.tables
To: user 'tarek'@'server.lab.local'
To apply the changes for users we must make refresh for the databases
Try to login with user tarek:
To Create Table:
Table: names
Fields (user_id, username, password, email)
Type: VARCHAR (),CHAR (character type and length), INT (integer type and
length), NOT NULL, PRIMARY KEY, AUTO INCREMENT, TIME STAMP,
STRING.
Table: names
Fields: user_id, username, password, email
Values:1, tarekelbaz, iti@123, [email protected]
Note: values must written between single quotes.
Delete FROM
Tables= names
Where email field is '[email protected]'
NOTE: when we use delete option without using where statement it will delete
the table.
UPDATE
Table = names
SET the field password (from 'iti2123' to be '123')
Where the username field = 'adel'
To restore:
----------------------------------------------------------------------------------------------------
--------------------
Enable and install the following repos:
epel& repo.mysql.com
To enable web access for MYSQL:
Change the root account and root password
To enable the web server: