随笔分类 -  mysql

摘要:mysql -h192.168.1.27 -P3306 -uroot -proot显示最大连接数show variables like '%max_connections%';设置最大链接数set global max_connections=2000;//默认100--只对当前进程有效,服务重启还... 阅读全文
posted @ 2015-12-24 16:05 GrandKai 阅读(165) 评论(0) 推荐(0)
摘要:SELECT CONCAT('drop table ', table_name, ';') FROM information_schema.tables WHERE table_name LIKE '表前缀%' AND table_schema = '表空间名' 批量修改表名:SELE... 阅读全文
posted @ 2015-12-22 17:02 GrandKai 阅读(412) 评论(0) 推荐(0)
摘要:主表,从表【MySql】//http://my.oschina.net/cart/blog/277624空、RESTRICT、NO ACTION删除:从表记录不存在时,主表才可以删除。删除从表,主表不变更新:从表记录不存在时,主表才可以更新。更新从表,主表不变//http://my.oschina.... 阅读全文
posted @ 2015-12-12 11:13 GrandKai 阅读(221) 评论(0) 推荐(0)
摘要:MySQL可以通过field()函数自定义排序,格式:field(value,str1,str2,str3,str4),value与str1、str2、str3、str4比较,返回1、2、3、4,如遇到null或者不在列表中的数据则返回0.mysql> select * from driver_lo... 阅读全文
posted @ 2014-09-09 16:54 GrandKai 阅读(317) 评论(0) 推荐(0)
摘要:C:\Windows\system32>mysql -hlocalhoset -uroot -pEnter password: *****mysql> use sshDatabase changedmysql> show tables;+----------------+| Tables_in_ss... 阅读全文
posted @ 2014-09-09 12:38 GrandKai 阅读(1038) 评论(0) 推荐(0)