| Start MySQL as the MySQl root user. Change to the mysql database, which is also called the grant tables. The privileges are stored in a MySQL database, whose name is mysql. |
The db tableThe following shows that the test database (containing the albums table) and any database whose name begins with test_ can be accessed and modified by any user. The % wildcard under host matches any host system. The blank user matches any user. |
The user tableThe following shows that root on localhost (otherwise known as dtr.dtrbus.COM) requires a password and can do anything to any database.The Y attribute in the user table over-rides any N attribute in the db or host tables. A N attribute in the user table can be over-ridden by a Y attribute in the db or host tables.In general, only root should have Y privileges set in this user table since they are global. All other users should get their privileges from the db and hosts table. |
To allow MySQL access from other systems, we need to add an
entry to the user table as described above. Note that we only
need to supply allowed host, user name, and password since the
remaining fields will be N (no) if we don't specify them.
The following adds a user entry for
hostname: % (a wild card for any host)
username: winpc
password: winpass
Notice the reload to make the change take effect.
|