关闭外键检查:
SET FOREIGN_KEY_CHECKS = 0
创建新用户
grant all on dbname.tablename to username@hostname identified by 'password';
删除记录
delete from tablename where id='';
更新记录
update tablename set id='' where id='';
查看数据库连接情况:
show processlist;
查看数据库情况:
SHOW GLOBAL STATUS
备份数据库
mysqldump -uusernmae -ppassword dbname > dbname.sql
还原数据库
mysql -uusernmae -ppassword dbname < dbname.sql
shell下创建数据库
mysqladmin -uusername -ppassword create dbname
查看支持的存储引擎(phpmyadmin中也可以看到)
show engines;
从文件中插入数据
LOAD DATA INFILE '".$file."' INTO TABLE `test` FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n'( `time` , `md5` );
阅读(671) | 评论(0) | 转发(0) |