Logo         Community
  Trog
Services
The Company
Community
Columns
Your Account
Contact Us
 
 
Access Granted
Precisely control access to information with the mySQL grant tables.

| Meet Joe User |

Modifying the mySQL grant tables requires superuser access to the mySQL database server. So the first order of business is to ensure that you have this level of access, and can alter table records

If you've installed the server yourself, on your own development machine, you would have been told to enter a root password at the time of installation. Hopefully, you did this - too many people leave the password blank, thereby opening up a gaping security hole - and still remember the password you used.

To verify that you have the required access, log into the server as the "root" user

''.preg_replace(array('/  /', '/ /'), array('  ', '   '), '
$ mysql -u root -p
Enter password: ****
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 3.22.32

Type 'help;' or '\h' for help. Type '\c' to clear the buffer

mysql>
').'
'

and ensure that you can view the contents of the tables in the "mysql" database - this is the database that contains all the grant tables.

''.preg_replace(array('/  /', '/ /'), array('  ', '   '), '
mysql> USE mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> SHOW TABLES;
+-----------------+
| Tables in mysql |
+-----------------+
| columns_priv    |
| db              |
| host            |
| tables_priv    |
| user            |
+-----------------+
5 rows in set (0.00 sec)
').'
'

Of course, root-level access is typically available only to the system administrator - other users have a lower security rating and, consequently, limited access. Each of these "ordinary" users will typically connect to the database by supplying his or her own user name and password - like this:

''.preg_replace(array('/  /', '/ /'), array('  ', '   '), '
$ mysql -h localhost -u joe -p
Enter password: *********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7 to server version: 3.22.32

Type 'help;' or '\h' for help. Type '\c' to clear the buffer

mysql>
').'
'

The purpose of the mySQL grant tables is to make it possible to manipulate security settings for these "ordinary" users, and customize each user's level of access to a very fine degree.


How to do Everything with PHP & MySQL
How to do Everything with PHP & MySQL, the best-selling book by Melonfire, explains how to take full advantage of PHP's built-in support for MySQL and link the results of database queries to Web pages. You'll get full details on PHP programming and MySQL database development, and then you'll learn to use these two cutting-edge technologies together. Easy-to-follow sample applications include a PHP online shopping cart, a MySQL order tracking system, and a PHP/MySQL news publishing system.

Read more, or grab your copy now!


previous page more like this  print this article  next page
 
Search...
 
In trog...
Logging With PHP
Building A Quick-And-Dirty PHP/MySQL Publishing System
Output Buffering With PHP
Date/Time Processing With PHP
Creating Web Calendars With The PEAR Calendar Class
more...
 
In the hitg report...
Crime Scenes
Animal Attraction
Lord Of The Strings
more...
 
In boombox...
Patience - George Michael
Think Tank - Blur
My Private Nation - Train
more...
 
In colophon...
Hostage - Robert Crais
The Dead Heart - Douglas Kennedy
Right As Rain - George Pelecanos
more...
 
In cut!...
American Chai
The Core
Possession
more...
 
Find out how you can use this article on your own Web site!


Copyright © 1998-2018 Melonfire. All rights reserved
Terms and Conditions | Feedback