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.
Things MYSQL client does ,
- Authentication for password check.
- SQL queries will be changed to tokens , that tokens will be given to MYSQL server.
- To monitor the Encrypt and compress network.
- Then it gets the response from server and displays to the front end tool.
Things MYSQL Server does ,
- 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 கீழ இருக்கிற எல்லா வேலையும் பண்ணும் ,
- connection decrypt or encode.
- Queries check and parse them.
- Get the Catched queries from Query cache
- Then it sends to Storage Engine.
- Disk and memory logs are its responsibility.
Storage Engine Layer
- Database, tables , indexes are taken care here or managing.
- Above related logs are taken care.
- It also sends data to other MYSQL servers via network is also done.
INSTALLATION
sudo apt-get install mysql-server mysql-client
sudo mysql_secure_installation
Gave y & 0
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
create a backup file of the configuration like below,
sudo cp my.cnf my.cnf_bk_june172024 [ TBD , change in the config location ? ]
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 ]
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 :
- GPL --> General Public License.
- RDBMS --> Relational Database Management System
- Control + l --> Top of the screen in Linux
- Note , if any changes in my.cnf MYSQL server needs to be restarted.
- Configuration file is in /etc/mysql/mysql.conf.d/mysqld.cnf
- sudo find / -name "*.cnf"
- https://www.tecmint.com/mysql-gui-tools-for-linux/