TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

MySQL

Working with MySQL Command Line

Introduction

In this tutorial, we will learn basic steps involved working with the MySQL command line. The most basic way to work with MySQL is to connect to the database from the command prompt. You need to connect to a database to create tables, view data, etc. Let’s see how to connect to MySQL and run a sample SQL query. This is very important because it is very much like the way your programs will interact with the database.

Connect to MySQL

On Windows, choose Run from the Start menu, type “cmd” and press the Enter key.

To Run mysql.exe, type

/> mysql -u root -p 

Enter your password for the user.

Note that you need to add the MySQL executable bin directory path to the environment variables.

 

Use a database

MySQL database might have several databases on the same relational database system. To view all the databases use the below command.

mysql> show databases;

 

To connect to a particular database, type the use command

mysql> use sakila;

To view all the tables in the sakila database type the following command.

mysql> show tables;

 

 

—

MySQL Tutorials

MySQL Tutorials on this website:

https://www.testingdocs.com/mysql-tutorials-for-beginners/

For more information on MySQL Database:

https://www.mysql.com/

Related Posts

DataGrip Desktop Shortcut

MySQL /

Launch DataGrip on Windows

DataGrip Download

MySQL /

Install DataGrip IDE on Windows 11

MySQL Workbench Windows 11

MySQL /

New MySQL Connection in Workbench

MySQL Command-line Client

MySQL /

Command-Line MySQL Client

Start MySQL Client

MySQL /

Start MySQL Client on Windows 11

‹ MySQL Joins› Install MySQL Server on Linux

Recent Posts

  • MS Access Data Types
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version