Thursday, 29 July 2021

*Episode 1* MySQL (P) [Basic Introduction, Database and Installation of MySQL]

 


Introduction


     In this episode we will describe what really MySQL is and what it is used for. We will describe some common database terms and then install MySQL on Window and Linux.


What is MySQL?


     MySQL is one of the most popular relational database management systems (RDBMS). It is open source and available under the terms of the GNU General Public License, which means that you can download, run, share and even modify MySQL for free. MySQL is a popular choice of database for web applications, and is a component of the widely used LAMP open-source web application stack.


     A relational database management systems (RDBMS) is a database management system (DBMS) based on the relational database model. MySQL is a fast and easy-to-use RDBMS and is used by many web applications such as WordPress, phpBB, Joomla!, Drupal, etc.


     MySQL uses a standard form of the well-known SQL data language. SQL stands for Structured Query Language and it is a special-purpose programming language designed for managing data held in a relational database management system. Many other RDBMSs use SQL as well, such as Oracle and Microsoft SQL Server. SQL syntax is loosely based on English and looks like this:


SELECT name FROM customers WHERE city = ‘Berlin’;


     MySQL is available on many operating systems, including Windows, Linux, Solaris, OS X, and FreeBSD. It can be accessed and administer via the command line or a GUI.


Database terms


     You need to know the main terms related to MySQL and databases in general:


  • Database - a container for a collection of MySQL data.
  • Table - a subcontainer within a database that stores the actual data.
  • Column - a name of a field within a row.
  • Row - a single record within a table.
  • Primary key - a key that uniquely identifies each record in a database table.
  • Foreign key - a key in one table that points to a Primary key in another table.
  • Index - a special lookup table that the database search engine use to speed up data retrieval.

Install MySQL on Windows


     Before installing MySQL on Windows, we need to dowload it. Go to http://dev.mysql.com/downloads/ and select DOWNLOAD under MySQL Community Server (GPL):



     Choose Windows as the platform and download the installer:



     If prompted for the login, log in with your account or create a new one. After the download finishes, start the installer. Accept the license agreement and click Next:



     Choose the setup type and click Next:


     Click Execute to install the components:


     Next, the wizard will guide you through the product configuration:



     Choose your network settings of leave the defaults:



     Next, you will be prompted to choose the root password:



     Next, choose the name for the MySQL Windows service:



    Click Execute to apply the changes:



     And that’s it! MySQL should be installed.


Install MySQL on Linux


    Installing MySQL on Linux is really simple and usually involves just a single command. We will show you how you can install MySQL on Ubuntu, a popular Linux distribution.


     Open the shell and type sudo apt-get install mysql-server:



     You will be promted for confirmation. Press Y to continue.


     During the installation process you will be prompted to enter and repeat the password for the root user:



     And that’s it! You have installed MySQL on your Linux machine.


Access MySQL


     There are three main ways in which you can access MySQL:


  • using the command line - you can access your MySQL server using the mysql command. You need to provide the username and password.


     Once inside the MySQL command-line interface, you can execute various commands to manipulate your databases and tables:



  • using MySQL Workbench - this is a GUI tool that enables you to manage your databases. This application enables you to connect to multiple servers and features a built-in query tool and command shell:


  • phpMyAdmin - a tool written in PHP that enables you to a MySQL database server from a user-friendly environment:


    {NOTE - all SQL commands are the same, regardless of the interface.}

Start the command-line interface

     To access the command-line interface from Windows, select Start > Run and type cmd:


     This will open the Command Prompt. Browse to the directory in which you’ve installed MySQL. The MySQL executable can be found in the bin directory. To start the MySQL command-line interface, enter mysql -u root -p:


     You will be prompted for a password. Enter the password you’ve selected during the
installation process and press enter. You should be in the MySQL command-line interface:


     From the MySQL command-line interface you can manage your MySQL Server installation and your databases.


                                                                                                            Episode 2 (MP)👉
Share this Post

PRINT THIS POST

No comments:

Post a Comment

If you have any doubts. Please let me know.

Featured post

*Episode 1* MCQ for Govt. Job/ Private Job/ MNCs

  Topic:- One Word Substitution 1) Especially skilled in storytelling  Answer:- Raconteur 2) Fear of loneliness Answer:- Eremophobia  3) Usa...