Choosing the right SQL Version: A Comprehensive Guide to MySQL, SQL Server, and More for Beginners

Getting started with SQL 

 

There are several SQL variants available in the market. For an established professional, it is easy to get it sorted, as they already tend to posses a history of usage of multiple SQL versions. But, in the case of a complete beginner it all boils down to three points, which are

  • Ease of Installation
  • Ease of Use
  • Availability of Support & Knowledge repositories

Based on my research, I have compiled my opinion on the above categories and classified the SQL providers in below table

SQL Database Providers

SQL Provider Ease of Installation Ease of Use Support & Knowledge Availability
Microsoft SQL Server Easy (Basic & Custom options) User-friendly (SSMS) Strong community & extensive resources
MySQL Easy (Installer & Docker) Web-based tools & CLI Large community & abundant tutorials
PostgreSQL Moderate (Installers & Package Managers) Robust CLI & pgAdmin Active forums & comprehensive docs
SQLite Very easy (No installation) Simple API Good official documentation

I have compiled the installation procedure for Microsoft SQL Server, and MySQL here based on the installation manuals provided by respective suppliers websites.

Installing Microsoft SQL and Setting Up for Practice

Windows Installation

  1. Download SQL Server:
  2. Install SQL Server:
    • Double-click the downloaded file (e.g., SQL2019-SSEI-Dev.exe).
    • Choose the Basic installation type.
    • Accept the License Agreement and click Install.
    • Note down the instance name and connection string displayed at the end of the installation.
  3. Install SQL Server Management Studio (SSMS):
    • On the completion screen, click Install SSMS.
    • Download the SSMS installer and run it.
    • Follow the prompts to complete the installation.
  4. Connect to SQL Server:
    • Open SSMS from the Start menu.
    • Click Connect in the Object Explorer panel.
    • Use default server values to connect.

macOS Installation

For macOS, you can use Docker to run SQL Server:

  1. Install Docker:
  2. Pull SQL Server Image:
    • Open Terminal and run:
      docker pull mcr.microsoft.com/mssql/server
  3. Run SQL Server Container:
    • Start a new SQL Server container with:
      docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=YourStrong!Passw0rd' \
      
      -p 1433:1433 --name sqlserver \
      
      -d mcr.microsoft.com/mssql/server
      Replace `YourStrong!Passw0rd` with a strong password of your choice.
  4. Connect to SQL Server:
    • Use a tool like Azure Data Studio or SSMS (available on Windows) to connect using `localhost` as the server name and `SA` as the username.

Linux Installation

You can also use Docker or install directly:

Using Docker:

  1. Install Docker:
  2. Pull SQL Server Image:
  3. 
    
            docker pull mcr.microsoft.com/mssql/server
    
           
  4. Run SQL Server Container:
  5. 
    
            docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=YourStrong!Passw0rd' \
    
    -p 1433:1433 --name sqlserver \
    
    -d mcr.microsoft.com/mssql/server
    
           

Direct Installation:

  1. Add Microsoft Repository:
  2. 
    
            sudo su
    
            curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
    
            curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list > /etc/apt/sources.list.d/mssql-release.list
    
            exit
    
            
  3. Install SQL Server:
  4. 
    
            sudo apt-get update
    
            sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17
    
            sudo apt-get install -y mssql-tools unixodbc-dev
    
            
  5. Configure SQL Server:
  6. 
    
            sudo /opt/mssql/bin/mssql-conf setup
    
           

After installing SQL Server on your preferred operating system, you can start practicing by creating databases, tables, and executing queries using SSMS or other database management tools.

Installing MySQL and Setting Up for Practice

Windows Installation

  1. Download MySQL Installer:
    • Visit the MySQL Downloads page.
    • Choose the appropriate installer:
      • mysql-installer-web-community-8.0.x.msi for a web-based installation.
      • mysql-installer-community-8.0.x.msi for a full installer.
  2. Install MySQL:
    • Double-click the downloaded .msi file.
    • Follow these steps:
      1. Choose Setup Type: Select "Full" or "Developer Default".
      2. Check Requirements: The installer will check system requirements and automatically resolve any issues.
      3. Installation: Click "Execute" to install the selected products.
      4. Product Configuration:
        • Choose "Standalone MySQL Server".
        • Set the configuration type to "Development Computer" and connectivity to "TCP/IP" on port 3306.
      5. Authentication Method: Choose "Use Strong Password Encryption for Authentication".
      6. Accounts and Roles: Set a password for the root account.
      7. Windows Service: Keep default settings to configure MySQL as a Windows service.
      8. Apply Configuration: Click "Execute" to apply the configuration.
  3. Verify Installation:
    • Open the MySQL Command Line Client from the Start menu.
    • Enter your root password to access the MySQL server.

macOS Installation

  1. Download MySQL DMG Archive:
  2. Install MySQL:
    • Open the downloaded DMG file and run the installer package.
    • Follow these steps:
      1. Accept the license agreement.
      2. Choose the installation type and click "Install".
      3. Enter your macOS password when prompted.
  3. Start MySQL Server:
    • Use System Preferences > MySQL to start/stop the server.
    • Alternatively, use Terminal:
      sudo /usr/local/mysql/support-files/mysql.server start
      .
  4. Verify Installation:
    • Open Terminal and run:
      mysql -u root -p
      .
    • Enter your root password to access the MySQL shell.

Linux Installation

You can install MySQL using package managers or Docker.

Using APT (Debian/Ubuntu):

  1. Update Package Index:
  2.  
    
        sudo apt update
    
       
  3. Install MySQL Server:
  4. 
        sudo apt install mysql-server
    
       
  5. Secure MySQL Installation:
  6. 
        sudo mysql_secure_installation
    
       
    - Follow prompts to set up security options like root password and remove test databases.
  1. Start MySQL Service:
  2. 
        sudo systemctl start mysql
    
      
  3. Verify Installation:
  4. - Access the MySQL shell:
    
    
        mysql -u root -p
    
      

Using Docker:

  1. Pull MySQL Docker Image:
  2. 
     docker pull mysql
    
      
  3. Run MySQL Container:
  4.  
     docker run --name=mysql-container -e MYSQL_ROOT_PASSWORD=YourStrong!Passw0rd -d mysql
    
       
    - Replace `YourStrong!Passw0rd` with a strong password.
  5. Verify Installation:
  6. Connect to your running container:
     
    
         docker exec -it mysql-container mysql -u root -p
    
       

After installing MySQL on your preferred operating system, you can start practicing by creating databases, tables, and executing queries using either command-line tools or graphical interfaces like MySQL Workbench or phpMyAdmin.




Any major changes in installation method or release of major version of software's will be reported and links will be updated to latest available versions.

Post a Comment

Previous Post Next Post