当前位置:知识百科 > 正文

怎么查看mysql函数

更新时间:2026-03-06 23:07 阅读量:182

mysql怎么查询当前支持的所有函数

SELECT DATABASE();

如下图所示:

安装了MySQL数据库,想查看一下版本号,VERSION()返回当前数据库版本,代码如下:

SELECT VERSION();

怎么查看mysql中已定义的自定义函数

有以下提示供参考:

①.、从 chaxun 的函数定义来看,只传递了一个 $str 参数,而函数中直接就使用了 $conn ,如果这个$conn 并不是全局变量,那么就会出错.

MySQL数据库开启、关闭、查看函数功能的方法

应用

MySQL

时,会遇到不能创建函数的情况.出现如下错误信息:

复制代码

代码如下:

ERROR

:

This

function

has

none

of

DETERMINISTIC,

NO

SQL,

or

READS

SQL

DATA

in

its

declaration

and

binary

logging

is

enabled

(you

*might*

want

to

use

the

less

safe

log_bin_trust_function_creators

variable)

那是因为没有将功能开启.

开启MySQL函数功能:

SET

GLOBAL

log_bin_trust_function_creators=1;

关闭MySQL函数功能:

log_bin_trust_function_creators=0;

查看状态:

show

variables

like

'%func%';

mysql函数查看

查询数据库中的存储过程和函数

select +name+ from mysql.proc where db = 'xx' and +type+ = 'PROCEDURE' //存储过程

select +name+ from mysql.proc where db = 'xx' and +type+ = 'FUNCTION' //函数

show procedure status; //存储过程

show function status; //函数

查看存储过程或函数的创建代码

show create procedure proc_name;

show create function func_name;

查看视图

SELECT * from information_schema.VIEWS //视图

SELECT * from information_schema.TABLES //表

查看触发器

SHOW TRIGGERS [FROM db_name] [LIKE expr]

SELECT * FROM triggers T WHERE trigger_name="mytrigger" \G

以上就是正洁生活网小编为大家整理的怎么查看mysql函数相关主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!