எளிய தமிழில் MySQL - [ 1 to 30 Pages ]
Published: 2024-06-17 16:14:19

- **Database** --> Its a software to store data in a structured way.

- **SQL** --> Structure Query Language - Its a language used to store data in database.

- **RDBMS** --> Its management software used to connect the data database.

Now coming to **_MYSQL_** : Its a RDBMS software , Free software under GPL.

- It as server and client.
- MYSQL Client --> Front end Tool / Console Prompt in windows / Shell prompt, we type the command here. 
- MYSQL Server --> Will take the command from client and execute in server , which we can't see.It just gives the result.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0i9s705t1i8khvhyn4ix.png)

Things **_MYSQL client_** does ,

1. Authentication for password check.
2. SQL queries will be changed to tokens , that tokens will be given to MYSQL server.
3. To monitor the Encrypt and compress network.
4. Then it gets the response from server and displays to the front end tool.

Things **_MYSQL Server_** does ,

1. Gets the request from client and then sends the response . **_Management Layer & Storage Engine _** are responsible for this. ( Memory , Disk & Network are interconnected to these layer mentioned above )

# Management Layer

Gets the request from client and கீழ இருக்கிற எல்லா வேலையும் பண்ணும் ,

1. connection decrypt or encode.
2. Queries check and parse them.
3. Get the Catched queries from Query cache 
4. Then it sends to Storage Engine.
5. Disk and memory logs are its responsibility.

# Storage Engine Layer

1. Database, tables , indexes are taken care here or managing.
2. Above related logs are taken care.
3. It also sends data to other MYSQL servers via network is also done.

# INSTALLATION

```
sudo apt-get install mysql-server mysql-client
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8g8d9mslcjarl75e7172.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8sy37uophppnega2lgpk.png)

```
sudo mysql_secure_installation
```
Gave y & 0

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pyg5ltz1qpx7oqb65bq4.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kopp2t1rgh0w2e5o4po1.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cqregr3yrca3d5yyl1rg.png)

In short , remove the anonymous user , only root can be executed only in localhost & remove the test database.

# CONFIGURATION

`cat /etc/mysql/my.cnf --> எல்லா configurationனும் இங்க தான் இருக்கும். OR /etc/mysql/mysql.conf.d/mysqld.cnf`

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a4iwpnc6rw5qcklyhvfe.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lel30kaa5lnqiajeeb5g.png)

create a backup file of the configuration like below,

```
sudo cp my.cnf my.cnf_bk_june172024 [ TBD , change in the config location ? ]
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ww2bqwk3vo1pj2io2m37.png)

```
port = 3306
user = mysql
data dir = /var/lib/mysql
bind-address = 127.0.0.1
log_error = /var/log/mysql/error.log

[ Parameters to be seen ]

```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qxgbf5iney2ou0i3dthq.png)

# Query Cache [ TBD , where to put these values ? ] 

All the queries which are executed in MYSQL Server , results are stored in cache. 

query_cache_limit = 1m
query_cache_size = 16m

m --> MB
This m can be raised or decreased depends on the RAM.

# Server Stop & Start

sudo service mysql restart
sudo service mysql stop
sudo service mysql start

# MYSQL Client Installation 

There are many in market,

sudo apt-get install MySQL-workbench --> second mostly used
sudo apt-get install MySQL-navigator
sudo apt-get install emma
sudo apt-get install MySQL-admin
sudo apt install phpmyadmin -y --> Best in market --> 1st

# Notes :

1. GPL --> General Public License.
2. RDBMS --> Relational Database Management System
3. Control + l --> Top of the screen in Linux
4. Note , if any changes in my.cnf MYSQL server needs to be restarted.
5. Configuration file is in /etc/mysql/mysql.conf.d/mysqld.cnf
6. sudo find / -name "*.cnf"
7. https://www.tecmint.com/mysql-gui-tools-for-linux/

# Reference

https://freetamilebooks.com/download/%e0%ae%8e%e0%ae%b3%e0%ae%bf%e0%ae%af-%e0%ae%a4%e0%ae%ae%e0%ae%bf%e0%ae%b4%e0%ae%bf%e0%ae%b2%e0%af%8d-mysql-a4-pdf/?tmstv=1712985924

https://kaniyam.com/ebooks/

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9c60odbwj8grzp4u6oqp.png)