MySQL Basics In Pictures
Starting
Administration
Tables
Queries
Security
Web
Restrict a user
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
GRANT
ed 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.
Close the MySQL database connection, then exit the terminal window.
<< BACK
NEXT >>