mssql查询:
SELECT so.[id] AS ObjectID,so.[name] AS ObjectName, so.XType,
(CASE WHEN (LEFT(text, 2) = '/*')
AND (charindex('*/', text) > 0) THEN substring([text], 3, patindex('%*/%', text) - 3)
ELSE '' END) AS Comments
FROM syscomments AS sc full join sysobjects AS so ON so.[id] = sc.[id]
WHERE so.[xtype] = 'U' OR so.[xtype] = 'V'
mysql表注释查询:
select table_name,table_comment from information_schema.tables where table_schema = 'image' and table_name ='tableName'mysql 怎么查看在执行什么语句开启记录MySQL执行过SQL语句的方法很简单:编辑/etc/my.cnf文件,在[mysqld]节下面添加:log=/var/lib/mysql/sql_row.log行(日志的路径自己根据需要定义)。
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
log=/var/lib/mysql/sql_row.log
# Disabling symbolic-links is recommended to prevent assorted security risks
# to do so, uncomment this line:
# symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
修改完毕后,记得重启 MySQL:
service mysql restart
# 或者
/etc/init.d/mysqld stop
/etc/init.d/mysqld start
现在你去 /var/lib/mysql/ 路径下的 sql_row.log 文件应该是能够看到 MySQL 什么时候执行了哪些程序了。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)