博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
sql常用命令
阅读量:4042 次
发布时间:2019-05-24

本文共 1342 字,大约阅读时间需要 4 分钟。

mysql -utest -p -h 192.168.100.10      oracle的用户只有sysdba sysoper可以启动停止数据库/etc/my.cnf   skip-grant-tableslog-bin=mysql-bin  开启bin-log日志set password=password('123qwe');set password for test@'%'=password('123qwe');update mysql.user set password=password('123qwe') where use='root';create table people(id int(10),name char(32),sex char(6))describe peopleinsert into people (id,name,sex) values (1,'Rain','man'),(2,'Alex','w')insert into a1 (id,name) select id,name from a2  表间数据复制delete from a2 where id=3delete from a2 where age between 20 and 30; a2中删除年纪在20到30的记录update a2 set age=17 where id=2; 修改表数据,将年龄改为17alter table a2 rename table2  改表名alter table a1 modify name char(30)  修改表的字段的属性alter table a1 change name usernam(1) after id;在id字段后添加sex字段alter table a1 drop time;删除time字段grant all on . to test@'%' identified by '123qwe';grant select on redis.* to test@'%' identified by '123qwe'show grants for test@'%'添加权限使用grant,取消权限使用revokemysql -uroot -p aa>~/1.sql 备份aa数据库mysql -uroot -p --databases aa test>2.sql 同时备份aa和test数据库mysql -uroot -p aa<1.sql 将备份的数据导入数据库mysqlhotcopy --flushlog -u='root' -p='456' --regexp=^a /mnt备份以a开头的数据库到/mnt下还原的时候直接将备份文件copy -a 到/var/lib/mysql/下mysqlbinlog mysql-bin.00001 查看sql的bin-log日志mysqlbinlog --start-position 264 --stop-position 341 mysql-bin.00001|mysqlstart slave; start master;show slave status\G; 查看原文:

转载地址:http://xqmdi.baihongyu.com/

你可能感兴趣的文章
一些socket的编程经验
查看>>
socket编程中select的使用
查看>>
关于AIS编码解码的两个小问题
查看>>
GitHub 万星推荐:黑客成长技术清单
查看>>
可以在线C++编译的工具站点
查看>>
关于无人驾驶的过去、现在以及未来,看这篇文章就够了!
查看>>
所谓的进步和提升,就是完成认知升级
查看>>
为什么读了很多书,却学不到什么东西?
查看>>
长文干货:如何轻松应对工作中最棘手的13种场景?
查看>>
如何用好碎片化时间,让思维更有效率?
查看>>
No.147 - LeetCode1108
查看>>
No.174 - LeetCode1305 - 合并两个搜索树
查看>>
No.175 - LeetCode1306
查看>>
No.176 - LeetCode1309
查看>>
No.182 - LeetCode1325 - C指针的魅力
查看>>
mysql:sql alter database修改数据库字符集
查看>>
mysql:sql truncate (清除表数据)
查看>>
yuv to rgb 转换失败呀。天呀。谁来帮帮我呀。
查看>>
yuv420 format
查看>>
YUV420只绘制Y通道
查看>>