mysql md5字段问题
我试了下貌似不行,要么是先写后加密,要么是md5字段只能写MD5值。 展开
mysql 密码默认MD5加密的
字段类型:char(32)
用法: insert into table(password) values(MD5('000000'));
例子
mysql> create table tc(id int auto_increment not null primary key,password char(
32) not null);
Query OK, 0 rows affected (0.06 sec)
mysql> show tables
-> ;
+----------------+
| Tables_in_test |
+----------------+
| ta |
| tb |
| tc |
| test |
+----------------+
4 rows in set (0.00 sec)
mysql> insert into tc(password) values(MD5('000000'));
Query OK, 1 row affected (0.02 sec)
mysql> select * from tc;
+----+----------------------------------+
| id | password |
+----+----------------------------------+
| 1 | 670b14728ad9902aecba32e22fa4f6bd |
+----+----------------------------------+
1 row in set (0.00 sec)
mysql>