Chapter 12 . Security 323 MySQL Authentication and (Domain and web hosting)
Monday, October 22nd, 2007Chapter 12 . Security 323 MySQL Authentication and Privileges Prior to getting down to the dirty business of working with users, I believe it is necessary to give an overview of the MySQL authentication system. This includes the stages of authentication as well as the privileges that can be granted and revoked. (This also gives me another chance to get on a soapbox about passwords.) Overview of MySQL authentication The MySQL privilege system works on a number of levels prior to allowing access to the server. Unlike systems where simply a username and password are examined to determine access, MySQL uses the username, password, and host to determine access level for the database. MySQL uses a two-stage process for determination of your access level, the connection level and process level. Using these two levels, in two sequential steps, the MySQL server determines . Whether you are allowed to connect at all. . Whether you have privileges to perform the requested operation or statement. During the first stage, which I will refer to as the Connection Stage, the MySQL server combines the user and host provided as credentials and determines if the given combination is allowed to connect with the given password. 1. The first phase of the Connection Stage combines the host, user, and password columns from the userstable of the MySQL grants database. If no database is included in the connection request, access is granted or denied at this point. The host column within the grants database can contain any valid hostname, IP address, or localhost. In addition, the wildcards % and _ are valid as are netmask values. For all hosts, the % wildcard can be used. For example, username 192.168.1.% would grant access to username from any address within the 192.168.1.0/24 range. This is the same as username 192.168.1.0/255.255.255.0 . If given username % then username at any host would be allowed. If a database is included within the connection request, the second phase begins. 2. The second phase of the Connection Stage of authentication is to verify credentials for the database. This phase is performed against the dbtable of the MySQL grantsdatabase. The dbtable is examined for host, database, and user. If access to all databases is granted to the user, this stage automatically passes; otherwise access is granted or denied, depending on the information in the dbtable.
We recommend high quality webhost to host and run your jsp application: christian web host services.