How can I check string length before insert in MySQL? -
i created table next statements in mysql.
create table users ( username varchar(15) not null primary key, password varchar(15) not null, active bool default true )
so want create 2 trigger on table:
check username , password more 4 or 8 characters. (check minimum length of string in inserting new rows) make regular look check password. illustration want contains both upper case , lower case characters , numbers.please guide me. lot.
you can utilize stored procedure or trigger test info first mysql not back upwards check constraints unlike other rdbms
the stored procedure approach more obvious because tests before insert/update. triggers can quite opaque code maintenance later
however, i'm more concerned having plain text passwords in database. salt , hash you'd utilize etc?
mysql string triggers minimum
No comments:
Post a Comment