Starting off with MySQL shell 8.0 on Windows

Database is mainly used in storing data in the form of records(rows) and fields(columns). MySQL is an open source relational database management system which provides us with a wide variety of tools for managing the database.
Recently when I installed MySQL installer which consisted of:
  • MySQL Server
  • MySQL Connectors
  • MySQL Workbench and sample models
  • Sample Databases
  • MySQL for Excel
  • MySQL Notifier
  • MySQL for Visual Studio
  • Documentation
MySQL shell was an interactive Javascript, Python, or SQL interface supporting development and administration for the MySQL Server and is a component of the MySQLServer. 
Initially, I had some difficulty to start and work with MySQL shell which was slightly different from the traditional MySQL shell in terms of connecting and many more features. 

If we need the traditional mysql shell

C:\Program Files\MySQL\MySQL Server 8.0\bin > mysql -u user -p
eg: mysql -u root -p
then it will ask you to enter your password.


Coming back to MySQL shell Let's dive into it.

Download MYSQL shell from below link

Steps:
  1. Once the installation is complete start the MySQL shell by typing it in the windows desktop search as it is an application.
  2. As the new MySQL has an easy way to directly embedded it to any application and can be used in the application with the language of your choice.
  3. For connecting to the database   
    1. \connect root@localhost
    2. \sql
  4. Above \sql is to switch from MySQL JS to sql
  5. For viewing the databases
    1. show databases;
    2. use database_name;
  6. There are many new Shell functionalities that can be explored
    1. \quit
    2. using the above command you can exit out of the shell
  7. change to \JS
    1. \help pattern
    2. for example, \help sql   Gives you all the patterns matched   
That is all for the introduction of MySQL shell.                                                                       

Comments

  1. So I installed but it always begins in the JS mode. I have to use the \sql command everytime. What can I do so that I can work on sql mode permanently, without having to switch from JS each time?

    ReplyDelete

Post a Comment

Popular posts from this blog

Creating a MYSQL Database