Mysql commands
mysql -u -p
function | command | Comments |
---|---|---|
show info of all users in mysql | select * from mysql.user; | |
show 3 columns of users | select host, user, password from mysql.user; | |
show fields of table user | desc mysql.user; | |
SELECT count(*) as total from test_schema | get count |
Create a table:
CREATE table if not exists test_product (
P_I int unsigned not null primary key auto_increment,
PNAME varchar(45) not null,
PRICE int
);
Insert a record into a table:
INSERT INTO
cv2
.test_product
VALUES
(2,
‘B’,
200);
MYSQL Workbench
A GUI tool for MYSQL.