mysql> use zabbix mysql> desc users; +----------------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------------+---------------------+------+-----+---------+-------+ | userid | bigint(20) unsigned | NO | PRI | NULL | | | alias | varchar(100) | NO | UNI | | | | name | varchar(100) | NO | | | | | surname | varchar(100) | NO | | | | | passwd | char(32) | NO | | | | | url | varchar(255) | NO | | | | | autologin | int(11) | NO | | 0 | | | autologout | int(11) | NO | | 900 | | | lang | varchar(5) | NO | | en_GB | | | refresh | int(11) | NO | | 30 | | | type | int(11) | NO | | 1 | | | theme | varchar(128) | NO | | default | | | attempt_failed | int(11) | NO | | 0 | | | attempt_ip | varchar(39) | NO | | | | | attempt_clock | int(11) | NO | | 0 | | | rows_per_page | int(11) | NO | | 50 | | +----------------+---------------------+------+-----+---------+-------+ 16 rows in set (0.00 sec) mysql> select userid,alias,passwd from users; +--------+-------+----------------------------------+ | userid | alias | passwd | +--------+-------+----------------------------------+ | 1 | Admin | a9289c3c21539e20fd6a060256e30b09 | | 2 | guest | d41d8cd98f00b204e9800998ecf8427e | +--------+-------+----------------------------------+ 2 rows in set (0.00 sec) mysql> select userid,alias,passwd from users; +--------+-------+----------------------------------+ | userid | alias | passwd | +--------+-------+----------------------------------+ | 1 | Admin | a9289c3c21539e20fd6a060256e30b09 | | 2 | guest | d41d8cd98f00b204e9800998ecf8427e | +--------+-------+----------------------------------+ 2 rows in set (0.00 sec) mysql> update users set passwd=MD5(‘123456‘) where userid=1;#-------->MD5加密 Query OK, 1 row affected (0.04 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> select userid,alias,passwd from users; +--------+-------+----------------------------------+ | userid | alias | passwd | +--------+-------+----------------------------------+ | 1 | Admin | a9289c3c21539e20fd6a060256e30b09 | | 2 | guest | d41d8cd98f00b204e9800998ecf8427e | +--------+-------+----------------------------------+ 2 rows in set (0.00 sec) mysql> update users set passwd=MD5(‘123456‘) where userid=1; Query OK, 1 row affected (0.04 sec) Rows matched: 1 Changed: 1 Warnings: 0
时间: 2024-10-15 18:42:13