Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8300669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:38:46+00:00 2026-06-08T16:38:46+00:00

How do I get the hash generated after updates? thufir@dur:~$ thufir@dur:~$ mysql -u root

  • 0

How do I get the hash generated after updates?

thufir@dur:~$ 
thufir@dur:~$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 138
Server version: 5.1.58-1ubuntu1 (Ubuntu)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use nntp;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+---------------------+
| Tables_in_nntp      |
+---------------------+
| articles            |
| newsgroups          |
| newsgroups_articles |
+---------------------+
3 rows in set (0.00 sec)

mysql> describe newsgroups;
+-----------+----------+------+-----+---------+----------------+
| Field     | Type     | Null | Key | Default | Extra          |
+-----------+----------+------+-----+---------+----------------+
| id        | int(11)  | NO   | PRI | NULL    | auto_increment |
| newsgroup | longtext | NO   |     | NULL    |                |
| hash      | char(32) | NO   |     | NULL    |                |
+-----------+----------+------+-----+---------+----------------+
3 rows in set (0.00 sec)

mysql> show triggers;
+-----------+--------+------------+-----------------------------------------------------+--------+---------+----------+----------------+----------------------+----------------------+--------------------+
| Trigger   | Event  | Table      | Statement                                           | Timing | Created | sql_mode | Definer        | character_set_client | collation_connection | Database Collation |
+-----------+--------+------------+-----------------------------------------------------+--------+---------+----------+----------------+----------------------+----------------------+--------------------+
| make_hash | INSERT | newsgroups | BEGIN
    set new.hash = md5(new.newsgroup);
  END | BEFORE | NULL    |          | root@localhost | utf8                 | utf8_general_ci      | latin1_swedish_ci  |
+-----------+--------+------------+-----------------------------------------------------+--------+---------+----------+----------------+----------------------+----------------------+--------------------+
1 row in set (0.00 sec)

mysql> 
mysql> 
mysql> DELIMITER $$
mysql> 
mysql> USE `nntp`$$
Database changed
mysql> CREATE
    -> TRIGGER `nntp`.`make_hash_update`
    -> AFTER UPDATE ON `nntp`.`newsgroups`
    -> FOR EACH ROW
    -> BEGIN
    -> set old.hash = md5(new.newsgroup);
    -> END$$
ERROR 1362 (HY000): Updating of OLD row is not allowed in trigger
mysql> 
mysql> quit;
    -> exit
    -> ^CCtrl-C -- exit!
Aborted
thufir@dur:~$ 

Also, from the workbench, I see the old trigger:

enter image description here

but don’t see how to add an additional trigger.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T16:38:52+00:00Added an answer on June 8, 2026 at 4:38 pm

    It’s not after update, it’s before update, and new. Don’t quite understand the syntax, but this at least doesn’t generate syntax errors. Would’ve like to have use the workbench:

    thufir@dur:~$ 
    thufir@dur:~$ mysql -u root -p
    Enter password: 
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 144
    Server version: 5.1.58-1ubuntu1 (Ubuntu)
    
    Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
    This software comes with ABSOLUTELY NO WARRANTY. This is free software,
    and you are welcome to modify and redistribute it under the GPL v2 license
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    mysql> use nntp;
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A
    
    Database changed
    mysql> show triggers;
    +-----------+--------+------------+-----------------------------------------------------+--------+---------+----------+----------------+----------------------+----------------------+--------------------+
    | Trigger   | Event  | Table      | Statement                                           | Timing | Created | sql_mode | Definer        | character_set_client | collation_connection | Database Collation |
    +-----------+--------+------------+-----------------------------------------------------+--------+---------+----------+----------------+----------------------+----------------------+--------------------+
    | make_hash | INSERT | newsgroups | BEGIN
        set new.hash = md5(new.newsgroup);
      END | BEFORE | NULL    |          | root@localhost | utf8                 | utf8_general_ci      | latin1_swedish_ci  |
    +-----------+--------+------------+-----------------------------------------------------+--------+---------+----------+----------------+----------------------+----------------------+--------------------+
    1 row in set (0.00 sec)
    
    mysql> show create trigger make_hash;
    +-----------+----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+
    | Trigger   | sql_mode | SQL Original Statement                                                                                                                                             | character_set_client | collation_connection | Database Collation |
    +-----------+----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+
    | make_hash |          | CREATE DEFINER=`root`@`localhost` TRIGGER `nntp`.`make_hash`
    BEFORE INSERT ON `nntp`.`newsgroups`
    FOR EACH ROW
    BEGIN
        set new.hash = md5(new.newsgroup);
      END | utf8                 | utf8_general_ci      | latin1_swedish_ci  |
    +-----------+----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+
    1 row in set (0.00 sec)
    
    mysql> 
    mysql> DELIMITER $$
    mysql> 
    mysql> USE `nntp`$$
    Database changed
    mysql> CREATE
        -> TRIGGER `nntp`.`make_hash_update`
        -> BEFORE UPDATE ON `nntp`.`newsgroups`
        -> FOR EACH ROW
        -> BEGIN
        -> set new.hash = md5(new.newsgroup);
        -> END$$
    Query OK, 0 rows affected (0.19 sec)
    
    mysql> 
    mysql> show triggers;
        -> ^CCtrl-C -- exit!
    Aborted
    thufir@dur:~$ 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list of passwords in mySQL that are generated using $hash =
when using oracle forms to generate md5 hash, i get result that is different
As far as I know, there's no way to get url hash in a
Is there any way to get the previous hash using the history object ?I
Trying to get a value out of 2d array inside of a hash and
How can I get the value of the URL hash (eg PARAMETERS in url
I want to find (if they exist) any hash tags and get the first
I am currently stumped on recreating an HMAC MD5 hash generated by a Java
I would like to base64 encode a generated SHA-1 hash in Scala using Play
I have a change password page that needs to hash any passwords entered on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.