MySQL Basics In Pictures
Restrict a user
  1. Type:

    GRANT SELECT,INSERT ON us_presidents.* TO marty@localhost IDENTIFIED BY 'watch4keys';

    then press ENTER.

    This command string restores marty as a user of the MySQL server, but lessens his user privileges:

    marty is now GRANTed permission to give only the SELECT and INSERT commands to the database us_presidents.

    TIP: You usually want to give users only the privileges they need. Otherwise, a user may make changes to the database that you don't want or expect.
  2. Close the MySQL database connection, then exit the terminal window.