All about mysql

Log into mysql

mysql -u root -h your-hostname -p
password ->

List databases

show databases;

Connect to database

use name_of_db;

List Tables

show tables;

General Query

select * from wp_rg_lead_detail where lead_id = 10723 ORDER BY lead_id DESC;


-- all lead information
select * from wp_rg_lead_detail where lead_id = 10723 ORDER BY lead_id DESC;

DELETE from wp_rg_lead where id = 1;
DELETE from wp_rg_lead_detail where lead_id = 1;


Find last id we want to keep
select id from wp_rg_lead where date_created < 20170130 order by id DESC limit 1;

last id
10700

delete leads
delete from wp_rg_lead where date_created < 20170130;
delete from wp_rg_lead_detail where lead_id <= 10700;

3958

accunet_dev
#@HtGA7vUMxABzA8&F9B

Find all lead detail

GET A COUNT
Select count(*) from wp_rg_lead_detail where lead_id <= 10700 limit 1;

Post Content