随笔分类 -  Mysql/Mariadb

摘要:使用宝塔安装的mysql数据库 找到头文件在/www/server/mysql/include 实现在/www/server/mys... 阅读全文
posted @ 2022-05-15 21:49 贪睡地蜗牛 阅读(182) 评论(0) 推荐(0) 编辑
摘要:目录 简介 语法 总结 简介 存储过程和函数:类似于java中的方法 好处: 1、提高代码的重用性 2、简化操作 3、减少了编译次数并且减少了和数据库服务器的连接次数,提高了效率 #存储过程 含义:一组预先编译好的sql语句的集合,理解成批处理语... 阅读全文
posted @ 2022-05-15 21:49 贪睡地蜗牛 阅读(181) 评论(0) 推荐(0) 编辑
摘要:1、新建表 create table `t_files` ( id int auto_increment, file_name varchar(100) default '', file_type tinyint(4) default 0, par... 阅读全文
posted @ 2022-05-15 21:49 贪睡地蜗牛 阅读(219) 评论(0) 推荐(0) 编辑
摘要:运行 delete from t_files where id in (select id from t_files where find_in_set(id, getChildLst(1))); 报错:You can't specify target tab... 阅读全文
posted @ 2022-05-15 21:49 贪睡地蜗牛 阅读(136) 评论(0) 推荐(0) 编辑
摘要:解决方法 1、用root用户登录:mysql -u root -p 2、设置参数log_bin_trust_function_creators为1 set global log_bin_trust_function_creators = 1; 结果: ... 阅读全文
posted @ 2022-05-15 21:49 贪睡地蜗牛 阅读(122) 评论(0) 推荐(0) 编辑
摘要:函数和存储过程比较类似 1、存储过程可以有多个返回,比较适合做批量插入 2、函数有且仅有一个返回,比较适合处理数据后返回一个结果 语法 create function 函数名(参数列表) returns 返回类型 #声明 begin 函数... 阅读全文
posted @ 2022-05-15 21:49 贪睡地蜗牛 阅读(33) 评论(0) 推荐(0) 编辑
摘要:create procedure p4()begindeclare row_cat_id int;declare row_cat_n... 阅读全文
posted @ 2022-05-15 21:49 贪睡地蜗牛 阅读(18) 评论(0) 推荐(0) 编辑
摘要:mysql一个表中唯一ID生成就需要这个函数 Last_insert_id()是MYSQL提供的返回当前客户端最后一个insert或... 阅读全文
posted @ 2022-05-15 21:49 贪睡地蜗牛 阅读(766) 评论(0) 推荐(0) 编辑
摘要:功能: 插入文件 、插入用户、删除操作 其他功能: 1、检索操作应该应该由代码的sql操作进行,这时由user表中的bro_index来指向开始目录,并且要找file表的类型 2、分享操作由前端返回分享密码,分享操作由文件进行检索 注意: 1、fil... 阅读全文
posted @ 2022-05-15 21:48 贪睡地蜗牛 阅读(37) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示