您的位置:首页 > 数据库 > MySQL

mysql 命令行

2015-09-22 17:24 621 查看
drop database mustang;

create database mustang;

show databases;

use database mustang;

show tables;

select * from instance;


  

查看所有属性

desc instance;


  

更改一个字段

update instance set is_terminated=1 where name='vm_DEV_000001';


  

授权 grant 权限1,权限2,…权限n on 数据库名称.表名称 to 用户名@用户地址 identified by ‘连接口令’;

show grants for mustang@'9.123.156.124';


  

GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' \
IDENTIFIED BY 'NEUTRON_DBPASS';

GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' \
IDENTIFIED BY 'NEUTRON_DBPASS';


  

MySQL查询结果重定向到文件中


select col1,col2 into outfile 'c:\t.txt' from tablename


  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: