MySql

From RCATs
Revision as of 14:19, 9 July 2023 by Ali3nw3rx (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
## Connect to the MySQL server. There should not be a space between the '-p' flag, and the password.
mysql -u <user> -p<password> -h <IP address>

## Show all databases.
show databases;	

## Select one of the existing databases.
use <database>;	

## Show all available tables in the selected database.
show tables;

## Show all columns in the selected database.
show columns from <table>;	

## Show everything in the desired table.
select * from <table>;

## Search for needed string in the desired table.
select * from <table> where <column> = "<string>";