Start up MySQL and login as the root user by issuing this command from the shell prompt:
You should see MySQL started:
Now select the mymarket database:
Now you're in the mymarket database, let's create the user table:
Notice the constraints we've put on the users table, the username is the primary key (which makes sense, you should be able to identify a user record based on the username). The email address has a unique constraint as well because we don't want duplicate email addresses. Now let's add a record to create the root user with the password password:
Notice the password looks a bit wierd, 5f4dcc3b5aa765d61d8327deb882cf99. This is the MD5 hash of the the word "password", I won't go into details here, but the important thing to note is that it's a one-way algorithm and it always produces a 32 character string. That's it, we have a users table to track our users, and one administrative account so we can try logging in and out of the system.
blog comments powered by Disqus |