run MySQL with php from CD, hard drive, USB etc

There are various problems and alternative solutions to getting a dynamic site running from CD (or hard disk) This is just one..

  1. Download mysql-essential-4.1.9-win32.msi from
  2. run the installer application
    1. choose "custom" --> next
    2. change destination, put in J:\mysql (create folder - J: is the hard disk in this example) --> next
    3. --> install
    4. choose "skip sign-up" --> next
    5. uncheck "configure now" --> finish
    6. There should be no windows service installed (check Settings / control panel / services)
  3. download Dynamic-CD from and install on computer
  4. download php4isapi.dll php4ts.dll from
  5. open folder where Dynamic-CD has installed its redistributable files (normally J:\Program Files\PHD\DynamicCD\Redist) and rename to DynCd.exe to DynCdASP.exe. Copy DynCd.exe,php4isapi.dll and php4ts.dll into this folder. I don't think you need to copy phdMySQLCmd.exe in any more but it will do no harm!
  6. download XYZINFO site into its own folder J:\XYZINFO
  7. dump XYZINFO database into J:\XYZINFO ( (userid) xyzinfo (password) zyxdrowp - {XYZINFO (5)} {Export} {Structure and Data} {Save as File})
  8. rename dump file to makeXYZINFO.txt. Add in lines before create tables:
  9. copy phdMySqlStart.php into J:\XYZINFO
  10. copy db.php script files to relevant folders (\XYZINFO, \XYZINFO\ANNUAIRE, \XYZINFO\INFOXYZINFO etc as per previous ftp) also any of those script files that are different from the main site.
  11. create empty folder J:\img
  12. run dynamic-cd wizard on J:\XYZINFO and produce image in J:\img. Specify phdMySqlStart.php as the start page.
  13. after the wizard has complete choose to run the application on your hard disk.
  14. you should get the setup page. Check the debug checkbox to get the options at the bottom of the page.
  15. check the No option for using the database in the %TEMP% folder. Then create the user XYZINFO password zyxdrowp and run the option to Create the database.
  16. when you burn the project to CD burn the contents of the J:\img folder to the root of the CD and the whole of the J:\mysql (not just the contents) to the root of the CD. You can either copy the J:\mysql folder into the J:\img folder or drag and drop it as an additional item when you burn the CD i.e.

NB You ought to be able to do all of this section using the phdMySqlStart.php script, see above. However this is what it does so I will leave it here for reference!
open a dos command prompt window to test and set up mysql

  1. mysql\bin\mysqld
    window may hang, in which case close it then start command prompt again
    if you have previously run mysql on this hard disk partition you may get a complaint when you run this. In this case you might have to be more specific to stop it using previous settings ie

    mysql\bin\mysqld --port=3306 -basedir=\mysql --datadir=\mysql\data

  2. mysql\bin\mysql --user=root
    should bring up the mysql command line interface. Type:
  3. show databases;
    should list
  4. \q
    to go back to dos prompt
  5. mysql\bin\mysqladmin --user=root password xyz
    this changes the root password to xyz - don't forget it!
  6. mysql\bin\mysqladmin --user=root --password=xyz password abc
    this changes the root password from xyz to abc - don't forget that either!
  7. mysql\bin\mysqladmin --user=root --password=abc shutdown
    stops the mysql server running
  8. There is an extra complication if you are using a newer version of MySQL (ie v. 4.1.9) with older version of php (as used in the beta version of dyncd). This is caused by the changed password hashing used. To get round the problem you will have to define the user in the mysql command line interface and set the password type to old_password(). You will then have to run tmpmaker2.php which does not have the section where the user is defined from scratch. To set up the user you need to start mysqld as above and log into mysql as root. then create the user as follows:

    >grant all privileges on *.* to username@localhost;

    >set password for username@localhost = old_password('secret');