MYSQL 經常使用語句

1,查看SP的內容:html

use sys;
SHOW CREATE PROCEDURE ps_setup_enable_consumer;
SELECT body FROM mysql.proc WHERE db = 'sys' AND name = 'ps_setup_enable_consumer' ;
SELECT CAST(body AS CHAR(10000) CHARACTER SET utf8) FROM mysql.proc WHERE db = 'sys' AND name = 'ps_setup_enable_consumer' ;mysql

 

2,顯示錶的Schemasql

desc tablename;code

 

3,建立用戶htm

CREATE USER 'jeffrey'@'localhost' IDENTIFIED BY 'password';table

file:///C:/Users/shenyufeng557/Downloads/refman-5.7-en.html-chapter/refman-5.7-en.html-chapter/sql-syntax.html#create-userclass

查看權限:file

SHOW GRANTS FOR 'joe'@'home.example.com';權限

4,顯示 表的狀態db

 SHOW TABLE STATUS FROM  menagerie LIKE 'p%' ;

相關文章
相關標籤/搜索