mysql-关于Mysql设置触发器以后不能插入的问题
Jun 06, 2016 am 09:45 AMmysql触发器
我在Mysql中设置了一个触发器,在用户还没有修改用户名的情况下将uid作为默认的用户名:
enter code here
///触发器没法自己修改自己的表。。。
DELIMITER |
CREATE TRIGGER default_name AFTER INSERT ON user
FOR EACH ROW BEGIN
update user set NEW.user_name= NEW.uid;
END
|
然后插入了一条数据,发现出现了以下错误:
can't update 什么的、、
CSDN移动问答

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Reduce the use of MySQL memory in Docker

How do you alter a table in MySQL using the ALTER TABLE statement?

How to solve the problem of mysql cannot open shared library

What is SQLite? Comprehensive overview

Run MySQl in Linux (with/without podman container with phpmyadmin)

Running multiple MySQL versions on MacOS: A step-by-step guide

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?

How do I configure SSL/TLS encryption for MySQL connections?
