Index   -   Next  >


PHP With MySQL


PHP provides database connectivity

Let's have a closer look at MySQL

'The world's most popular open source database'

An Open Source, client/server RDBMS for SME's and beyond. Developed to provide a high performance, highly scalable, SQL database engine, MySQL was originally low on features but has grown up to be an enterprise level engine in a remarkably short period of time. This is in part due to it's incredible popularity attracting significant input from the open source community.

Being open source MySQL is available for just about any platform. If your platform is not available as a binary you can always compile it from source. Some sysops prefer to build on our server to optimise performance.

Good bits:

Not so good bits:

Bits not present when I first began to play with MySQL 3:
(studb.cms.gre.ac.uk is version 14.12 distribution 5.0.67)

MySQL was originally low on bells an whistles, which was part of it's appeal. If you are from an advanced database background MySQL versions up to 4 may have appeared to be lacking features.

All of this changed with the arrival of MySQL Version 5.0 in 2005 which introduced triggers and stored procedures. It is now possible to enforce referential integrity by using InnoDB tables instead of MyISAM tables. The PHP MySQL 'improved' API provides transactions, rollbacks. The situation continues to evolve with new releases of both MySQL and PHP.

The MySQL Community Server remains open source and free of charge but the Enterprise and Cluster releases take MySQL head-to-head with the established big players. This is arguably why Oracle were so keen to aquire MySQL when in April 2009 Sun Microsystems succumbed to the economic recession.

Access control in MySQL

Access control is managed through a MySQL database called mysql.
This has tables to manage server access control from aspects such as contacting the server down to fine grained access of specific columns in specific tables. Some of the more important tables are listed below...

Note that the MySQL server user names are not same entities as the operating system user names, although they may be identical strings. MySQL has a totally separate authentication system including its own password function.

The MySQL user called 'root' has all privileges and manages user access.
The db table is provided here as an example as it is reasonably easy to follow.
The SQL statement: SHOW COLUMNS FROM db produces:

FieldTypeNullKeyDefaultExtra
Hostchar(60) binary PRI  
Dbchar(60) binary PRI  
Userchar(60) binary PRI  
Select_privenum('N','Y')  N 
Insert_privenum('N','Y')  N 
Update_privenum('N','Y')  N 
Delete_privenum('N','Y')  N 
Create_privenum('N','Y')  N 
Drop_privenum('N','Y')  N 
References_privenum('N','Y')  N 
Index_privenum('N','Y')  N 
Alter_privenum('N','Y')  N 

Index   -   Next  >

Best viewed in a sensible browser
© k.mcmanus 2013
Valid XHTML 1.! . Valid CSS . WCAG priority 3 approved