duckiebear
Programmer
I'm trying to come up with a user database for logging onto my server where the passwords stored in the table under the column "password" are encrypted. I also need another script I have to understand when it's been 30 days since the password was changed, so I need to capture the date the password is changed. I've looked at a few reference manuals and tried the code:
But this does not appear to be correct, and adding the ENCRYPT code into the variable seems to be the wrong way of doing this. Any suggestions on how this is done? Has anyone created a table of users that log on to their server or another system using the MySQL database?
Code:
create database auth;
use auth;
create table auth (
name varchar(7) not null,
pass varchar(9) ENCRYPT not null,
fullname varchar(30) not null,
date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
deptnumber varchar(4),
phonenumber varchar(10),
cellnumber varchar(10),
primary key (name)
);
insert into auth values
('name', ENCRYPT 'pass', 'fullname', 'NOW()', 'deptnumber', 'phonenumber', 'cellnumber', );
insert into auth values
( 'someuser', ENCRYPT ('test12345'), 'Joe User', 'NOW()', '3421', '504 257-0000', 'none' );