Learning MySQL

Table of contents

Introduction

MySQL vs other DBMSs

MySQL client installation and basic operations

MySQL integration

Additional Resources

Introduction

The following is an introduction to MySQL with some resources to get started. This article assumes that the reader has some knowledge about Structured Query Languages (SQL). For more information about SQL in general, you can check out this link. A relational database management system (RDBMS) which is used to implement databases for any general application. MySQL is one of the most popular DBMSs because it is flexible, secure, and has high performance. For more details, click here.

MySQL vs other DBMSs

When choosing a database management system, there may be a lot of options. here are some comparisons between the most popular ones:

MySQL client installation and basic operations

The following is a summary from this guide which has many details, but here are the following steps:

  1. Download the client
    i) Linux
    Follow the instructions on this this link. For users using Debian or Ubuntu, use the APT documentation here and follow the 3 steps.
    ii) Windows
    Follow the instructions on this link which provides 3 steps in order to complete this step using an installer.
    iii) macOS
    Follow steps 1-8 from this link which shows you how to nagivate the Installer Wizard.
  2. Connect to the MySQL server using the mysql client
    i) Linux Based Systems
    Enter the following in the command line terminal
    $> mysql -u root -p
    ii) Windows
    Go to Start, All Programs, MySQL, MySQL (ver#) Command Line Client
  3. Run SQL statements to create schemas and run operations. Here are some examples

MySQL integration

There are many environments that can integrate a MySQL database. Here is how to do it in Node.js and Python

MySQL database connection to Node.js

Assuming that npm and node is installed (click here for npm instructions, use the following commands in the terminal

For more detailed steps, check out this link

MySQL database connection to Python

In order to connect to the database using Python, you need to use a database driver. Assuming that a recent version Python and pip is installed (click here for details installing pip), use the following commands:

For more detailed steps, check out this link

Additional Resources