当前位置:网站首页>Record today's MySQL failures
Record today's MySQL failures
2022-06-10 21:23:00 【Li_ XiaoJin】
There is a problem today , Morning yes MySQL Limit IP Access operation , Restrict it only through 192.168.137.% Access to this segment . I didn't expect that something would go wrong immediately , The Canadian website cannot submit the order for card purchase . Later, I checked and found that in the log , There are database errors .
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException:
### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: execute command denied to user 'mvno-ca'@'localhost' for routine 'cmi_mvno_ca.mvnoNextval'
### The error may exist in URL [jar:file:/home/ca/mvno-ca/lib/mvno-common-business-1.0-SNAPSHOT.jar!/mapper/WebformSubmissionData.xml]
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT mvnoNextval('mvno_sequence') from dual;
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: execute command denied to user 'mvno-ca'@'localhost' for routine 'cmi_mvno_ca.mvnoNextval'
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: execute command denied to user 'mvno-ca'@'localhost' for routine 'cmi_mvno_ca.mvnoNextval'
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982)
Finally, the following is verified SQL Report errors , This is the order number generated by placing an order to obtain the serial number , because MySQ No sequence , With a function to achieve . I use navicat Executed for a while , Found that the return is null, I feel the problem is a little serious , The customer has been complaining , Go back quickly .
SELECT mvnoNextval('mvno_sequence') from dual;
Continue to verify , Check out the implementation of this function
show create function mvnoNextval;
And found that [email protected] I checked the information on the Internet , Find out definer This value does not restrict the permissions invoked by functions and stored procedures , But it will restrict the access of functions and stored procedures to the database .
About definer and invoker The explanation of When creating a stored procedure, you can specify SQL SECURITY attribute , Set to DEFINER perhaps INVOKER, To inform mysql When executing stored procedures ,, In order to DEFINER To execute , Or execute with the permission of the caller .
By default , Use DEFINER The way , At this point, the user who calls the stored procedure must have the EXECUTE jurisdiction , also DEFINER The specified user must be in mysql.user Users present in the table .
DEFINER In mode , Default DEFINER=CURRENT_USER, When the stored procedure executes ,mysql Will check the DEFINER Defined users 'user_name'@'host_name' Authority ;
INVOKER In mode , When the stored procedure executes , Checks the permissions of the stored procedure caller . from:https://my.oschina.net/u/1424662/blog/485118
Now it needs to be solved definer The problem of , modify definer.
modify function、procedure Of definer
select definer from mysql.proc; -- function 、 stored procedure
update mysql.proc set definer='[email protected]'; -- If you have a limited number of libraries or anything, you can add where Conditions
modify event Of definer
select DEFINER from mysql.EVENT; -- Timing events
update mysql.EVENT set definer=' [email protected] ';
modify view Of definer
comparison function It's a bit of a hassle :
select DEFINER from information_schema.VIEWS;
select concat("alter DEFINER=`user`@`localhost` SQL SECURITY DEFINER VIEW ",TABLE_SCHEMA,".",TABLE_NAME," as ",VIEW_DEFINITION,";") from information_schema.VIEWS where DEFINER<>'[email protected]';
Just execute the query statement again .
modify trigger Of definer
At present, there is no specific and convenient method , The tool end can be used HeidiSQL、sqlyog Wait for a change . Note that it is necessary to lock the watch before modification , Because if there are other table changes in the process of change, trigger , It will cause data inconsistency .
Flush tables with readlock
Unlock tables
PlantUML Assignment2 Branch and bound problem
After this lesson , Find yourself right MySQL My understanding is still not enough , Still need to continue to learn !
Copyright: use Creative Commons signature 4.0 International license agreement to license Links:https://lixj.fun/archives/ Record today's fault
边栏推荐
- Redis cache penetration
- 你的公司会选择开发数据中台吗?
- The excess part of the table setting is hidden. Move the mouse to display all
- Brute force method / task assignment
- Read the source code of micropyton - add the C extension class module (3)
- 蛮力法/1~n的全排列 v3 递归
- LeetCode:1037. 有效的回旋镖————简单
- LeetCode:497. 非重叠矩形中的随机点————中等
- Elastic-Job的快速入门,三分钟带你体验分布式定时任务
- 【电脑使用】如何设置没有自启项的软件开机启动
猜你喜欢

KCon 2022 议题大众评选火热进行中!不要错过“心仪”的议题哦~

Electronic bidding procurement mall system: optimize traditional procurement business and speed up enterprise digital upgrading

LeetCode:497. 非重叠矩形中的随机点————中等

Talk about server performance optimization ~ (recommended Collection)

Magic tower game implementation source code and level generation

Theoretical basis of distributed services

Uncover secrets: how can wechat red envelopes in the Spring Festival Gala resist 10billion requests?

You have to learn math to play art?

标配双安全气囊,价格屠夫长安Lumin 4.89万起售

冷酸灵,一个国产品牌IPO的30年曲折史
随机推荐
魔塔类游戏实现源码及关卡生成
Unity analyzes the rendering of built-in terrain and does some interesting things
Codeforces Round #798 (Div. 2)
一、Vulkan开发理论基础知识
牛客网:数组中出现次数超过一半的数字
Connexion MySQL errorcode 1129, State hy000, Host 'xxx' is Blocked because of many Connection Errors
Error code 1129, state HY000, host 'xxx' is blocked because of many connection errors
获取的网络时间 + 时区(+8)
Obtained network time + time zone (+8)
Redis集群配置
设计多层PCB板需要注意哪些事项?
Talk about server performance optimization ~ (recommended Collection)
redis设置密码命令(临时密码)
聊聊服务器性能优化~(建议收藏)
面试必备——synchronized底层原理的基础知识
2台电脑共享一套键盘鼠标
Game compatibility test (general scheme)
Diablo immortal wiki address Diablo immortal database address sharing
35岁被裁员,还能拥有美妙人生吗?
ROS virtual time