MySQL常用
2015-06-13 11:43
399 查看
写于2011年,mysql5.1
1、导入导出
2、启动
3、执行文件
4、登录
5、创建用户
6、查所有表
7、查表的列
8、查看变量:
1、导入导出
select * from f_pc_user_cndt_20101128 into outfile 'd:/f.txt' Fields Terminated By ',' Lines Terminated By '\n' LOAD DATA local INFILE 'd:/f.txt' IGNORE into table f_pc_user_cndt_20101128 Fields Terminated By ',' Lines Terminated By '\n';
2、启动
/etc/init.d/mysqld-ib restart /usr/local/infobright/bin/mysqld_safe --defaults-file=/etc/my.cnf --user=mysql &
3、执行文件
mysql -uroot -ppassword fdp < fdp.sql
4、登录
/usr/local/mysql/bin/mysql -uroot -p123456 mysql -uroot -h127.0.0.1 -pemaradmin
5、创建用户
create database cuixz; GRANT ALL ON *.* TO cuixz@'%' IDENTIFIED BY 'cuixz'
6、查所有表
select trim(table_name), trim(table_comment), table_schema from information_schema.tables where table_schema in {0} order by table_schema, table_name
7、查表的列
select trim(column_name), trim(column_comment), column_type, case when left(column_key,1) = 'P' then 'Y' end, is_nullable from information_schema.columns where table_schema ='{0}' and table_name = '{1}' order by ordinal_position
8、查看变量:
SHOW VARIABLES LIKE 'character%'
相关文章推荐
- mysql日志
- slave中继日志损坏如何处理
- mysql gtid初探
- 在 mysql 中利用 Duplicate key, 一句话实现存在的更新不存在插入功能
- mysql存入中文乱码
- 记录下mysql的一些常识
- mySQL远程访问
- mysql表格拆分总结
- mysql中的comment用法
- mysql 的表名和列名设计时应该注意的一个问题
- MySQL+DRBD+heartbeat+LVS+keepalived
- php操作mysqli(示例代码)
- Mysql 分区 ------ Innodb 表引擎
- MySQL Server 5.5.44免安装版配置详解
- Mysql存储过程
- mysql学习笔记_函数
- mysql 编码测试
- mysql delimiter
- mysql 求时间段平均值
- mysql格式化操作