Frames Modems Help Home Page Chipsets Search No Frames
Diary Entries See also Site Info & Diary.
24 September 2001 Now to start building the Tables...
  An initial scan of the existing Manufacturer pages suggests that there needs to be 2 separate tables - one for modem manufacturers & one for computer manufacturers (who include a modem within their computers, but do not manufacture them). Pages built for these 2 have a different structure. It's possible that another separate table will be required for modem Retailers, but we'll find this out later.

Later, I'll need tables for the different modem chipsets. There will then be a table of actual modems (this will be big!). This latter will contain links to the earlier tables - a modem is manufactured by somebody & contains a chipset from (usually) somebody else. Some modems contain one of a number of chipsets... but I'm getting ahead of myself. One thing at a time, otherwise it's impossible.

  All my connections so far have been made as the user called "root" (the fundamental user installed by default - on Windows - on installation of MySQL, with access to everything). I've already introduced a password (on 19 Sep but written up at 19 Aug above) but when accessing the database on my webspace at uklinux.net the username is not root, so this needs adding (although the Hostname is "localhost" - same as my own system). In what follows, <DB> is the name of the database & <PW> is the password.

The MySQL Access Privilege System is chapter 6 in the HTML help file - I'll need to give the same user privileges for myself as upon the Webspace server (could be some knotty bugs otherwise) - but this is for later. Adding New Users to MySQL is at 6.14, and GRANT and REVOKE syntax is at 7.35.

  1. launch Apache, open a DOS window & change to C:\mysql\bin folder
  2. launch MySQL, then the MySQL monitor:
      mysqld
      mysql -u root -p
  3. create the new user, initially with no privileges at all, and with a password of <PW> (needs to be surrounded with single-quotes as shown) then grant specific privileges (ALL is shorthand for ALL PRIVILEGES) for the database:
      GRANT USAGE ON *.* TO 'modem-help'@localhost IDENTIFIED BY '<PW>';
      GRANT ALL ON <DB>.* TO 'modem-help'@localhost;
    (at first this appeared not to work - after some tables were created it worked fine.)
  4. now to create the first table - the list of Manufacturers; the CREATE TABLE syntax is at 7.7, properties of the different Column Types is at 7.3, Sizes of the different Types is at 7.3 & Storage Requirements at 7.3.1:
      USE <DB>;
      CREATE TABLE /mfc/ (
        MID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
        Name CHAR(10) NOT NULL,
        UsesID TINYINT UNSIGNED, /* boolean for modems */
        Dead TINYINT UNSIGNED, /* boolean for the deceased */
        Notes TEXT,
        Visits INT UNSIGNED,
        Updated TIMESTAMP NOT NULL,
        KEY(Name)
        );
    (updated 29 Sep - changing the PK to 2 fields allows just 1 table for both modem mfc & chipset mfc; originally also used ENUM (7.3.4.3), but using child (lookup eg busTypes) tables allows future possibility of multi-language databases)
    (updated 15 Oct - the TIMESTAMP type (7.3.3.2) is for automatic insertion of date/time on creation)
    (updated 28 Oct - Name needs a Key to speed up selection)
    (updated 01 Nov - lookup table for Names & Types added)
    (updated 17 Nov - Name removed & moved to names)
    (updated 22 Nov - cannot stand there not being a Name)
    (updated 24 Nov - added Dead)
    (updated 10 Dec - changed Notes from TINYTEXT to TEXT because 256 characters was not enough)
    (14 Jan - all tables continued now at 14 Jan)
  5. and finally,
      quit
      mysqladmin -u root -p shutdown