MySQL入门

连接MySQL

// local
mysql -u root -p
// remote
mysql -h ipaddress -P 3306 -u username -p

查看MySQL 

// 显示所有数据库
show databases;
// 选择某一数据库
use db_name;
// 显示数据库中所有表
show tables;
// 显示表中所有列
show columns from table_one;
// 显示索引
show index from table_one;

 操作MySQL

// 查看端口号
show global variables like 'port';
// 查看数据库编码
show variables like 'character%';
// 查看进程
SHOW processlist

 

posted @ 2015-07-28 17:25  Sawyer Ford  阅读(160)  评论(0编辑  收藏  举报