MySQL is an open-source relational database management system (RDBMS) widely used for storing and managing structured data.

What are MySQL Joins ?

MySQL joins allow you to combine rows from multiple tables based on a related column between them. They are used to retrieve data from multiple tables simultaneously, enabling you to create more complex queries and extract meaningful information. MySQL supports various types of joins, including INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN. Here's a detailed explanation of each join type:

  1. INNER JOIN:

How to Log All mysql queries into log file

Are you want to log queries in some files to see later what your system performance, in this session you can make it possible is just few commands.

we are using shell to execute this process because it is recommeded and most easiest one with restarting mysql server

so First login into mysql using shell, below command helps you, login using super access user

mysql -u username -p 

Now a shell prompted for password, Enter your password 

Import Database using xampp mysql command prompt windows

As we all know the xampp is most popular tool at machine level programming work, but sometime we need to deal with the bigger databases to import into mysql of xampp that provide and we import that using user interface then we will fail or not properly imported, I personally faced that issue many times so I just use the command prompt, because it is fastest way to do any task in any any operating systems.

For Importing database using xampp mysql, just follow the simple steps below, its quiet easy to do -

Retrieve the query used in mysql views

we can create the database views for many reason, but if we forget what query you was used to create the views or need to find out using which query results are generating here is the solution:

Below are the simple query to run and you will get the query:

SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME = 'yourviewname'

instead of 'yourviewname',type your views name to get the result.

Important Mysql Commands that will we used with ssh

Commands

Access monitor: mysql -u [username] -p; (will prompt for password)

Show all databases: show databases;

Access database: mysql -u [username] -p [database] (will prompt for password)

Create new database: create database [database];

Select database: use [database];

Determine what database is in use: select database();

Show all tables: show tables;

Show table structure: describe [table];

List all indexes on a table: show index from [table];

Export Mysql database using SSH

Export The database directly from command line is Easy and Fast.

Follow these steps to export the database using SSH (putty terminal)

1. Open the putty terminal of your server and go to your folder where you want to store your exported file.

2.Type Following command and press Enter:

$  mysqldump -p -h hostname -u username database_name > filename.sql

desp:(Replace your credential from above command)

 

Import Mysql database using SSH

Follow these steps to Import the database Mysql (Putty Terminal).

1. Login to your putty terminal.

2.You need to login in to Mysql, for this type

mysql -u username -p and Press Enter, Now type Your password and Hit Enter.

3.Now you logged in to Mysql,type command

show databases;

that will display all database list and to select the your database type command:

use database_name;

and press Enter.

4.Now for selecting file to import use command:

Subscribe to MySQL