MySQL Tutorial 2
Let's understand the basic concepts of General Database and MySQL database.
Below topics will give help you to understand Database basic concepts
What is a database?
---------------------
A database is a structured collection of data that allows for efficient storage, retrieval, and management of information.
It organizes data into tables, rows, and columns to make it easily accessible and maintainable.
Databases are used in almost every application—websites, mobile apps, banking systems, and more.
They support operations like inserting, updating, deleting, and querying data.
Most databases use SQL (Structured Query Language) for communication.
Examples include MySQL, Oracle, PostgreSQL, and MongoDB.
The database can be use for different purpose or achieve any specific requirements. Such as Oline transactions processing, Business intelligence, Analysis of Data.
Relational vs Non-relational databases
---------------------------------------
Relational databases store data in structured tables with rows and columns and use SQL for querying (e.g., MySQL, Oracle).
They support relationships through primary and foreign keys and are ideal for structured, consistent data.
Non-relational databases (NoSQL) like MongoDB store data in formats like JSON, key-value pairs, or documents.
NoSQL databases are more flexible and scalable for unstructured or semi-structured data.
Relational DBs ensure strong consistency, while NoSQL offers high performance and scalability.
Choosing between the two depends on the project requirements and data structure.
Overview of MySQL
-------------------
MySQL is an open-source relational database management system (RDBMS) developed by MySQL AB and now owned by Oracle.
It is widely used in web development, data warehousing, and enterprise systems due to its reliability and performance.
MySQL uses SQL to interact with data and supports features like transactions, indexing, views, and stored procedures.
It works across platforms such as Windows, Linux, and macOS and supports various storage engines like InnoDB and MyISAM.
MySQL is part of the LAMP stack (Linux, Apache, MySQL, PHP/Python).
Its community and enterprise editions serve both beginners and large-scale businesses.
Installing MySQL and MySQL Workbench
-------------------------------------
To install MySQL, download the installer from the official MySQL website and follow the setup steps.
The installer includes MySQL Server, MySQL Workbench, Shell, and other optional tools.
MySQL Workbench is a GUI tool that allows you to design, query, and manage databases easily.
During installation, you will set a root password and configure the server settings.
Choose the default configuration or customize ports, authentication method, and startup options.
After installation, launch MySQL Workbench to connect and manage your database instances.
Connecting to a MySQL server
------------------------------
To connect to a MySQL server, you need the hostname (or IP), port (default is 3306), username, and password.
Using MySQL Workbench, click on “New Connection,” enter your credentials, and test the connection.
You can also connect via command-line using `mysql -u root -p` and then entering the password.
Remote connections may require enabling the MySQL port in your firewall and updating the host settings.
Once connected, you can execute SQL queries, manage databases, and run administrative tasks.
Proper authentication and role management are key to securing your database connections.
Conclusion
In this tutorial we understand the basic of any database, relational vs non relational database. Connection to database.
Hopefully you got some basic knowledge will share more.
0 Comments