Re: Creating Mysql DB with PHP



"MS" <nospamplaesegr8t_ukuk@xxxxxxxxxxx> wrote in message
news:d7s6mo$61k$1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>> >>
>> >> Are you copying an existing database (since you mention a SQL dump)?
>> >
>> >
>> > I am Copying an existing database, which the sql dump is created from.
>>
>> If the original database is MySQL, then all you need to do is copy the
>> files.
>
> The original is MySQL
<...>
>> I'm guessing from this that it's not necessarily a one-time script, then?
>
> Its not a onetime script as I hope to package all the files together and
> distibute.

It occurs to me that you could include the database files with the package,
and have the configuration script copy them into the correct directory. This
is much faster than running it as queries, and you won't face the drawbacks
with copying the database a row at a time (or running it from a dump)

If you are running insert queries, the cycle will take much longer as the
database gets bigger, so you will reach a point where PHP timeouts interfere
with running the program. You can change the PHP timeouts, but then you run
into SQL timeouts - and so on :) The database I was working with required
everything to be broken up into smaller pieces & restart the process after a
pause.

Use mysql_create_db() to create the database. Creating a database in MySQL
consists of MySQL creating a directory in the MySQL data folder. All you
need to do after this is copy the 3 relevant database files into that
folder. If they're included with the distribution files, this would be a
simple matter.

Hope that helps at least a little


.



Relevant Pages

  • Re: MySQL Database problem (probably already solved in a message, but this is somewhat urgent)
    ... MySQL server has a database with a table, ... columns, an FSR column, and a password column. ... checked if the supposed arrays that were returned were actually arrays ...
    (comp.lang.php)
  • RE: FreeBSD 5.3 MySQL Performance
    ... versions of Linux and FreeBSD for most tests. ... > popular with the ATA disk drive manufacturers. ... > Many companies have used FreeBSD and MySQL for years and years. ... it is not often that you have such a small database and such a large ...
    (freebsd-questions)
  • ANN: Database Designer for MySQL version 1.6 is released
    ... The new version 1.6 of MicroOLAP Database Designer for MySQL has been ... The secure shell (SSH) tunneling is now implemented in Database ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: toolkits or APIs to create a web interface as a frontend to mysql
    ... I am also *not* looking for a web based full fledged mysql client. ... For simple display of tabulated data the most useful thing is a displaywhich uses 's with absolute coordinates to position text in a box of defined width, formatted to be left, right or center justified, an using a preselected style from a a style sheet. ... As far as the actual database calls go, those are specific to each form, and apart from a little coding so that 'database_open, database_close' exist in the library, taking such things as the database name, user name and password from an included file I find it easiest to simply do the query and iterate through it to display the data requested. ...
    (comp.os.linux.misc)
  • Re: PICK OPENDB provides connection in shopping cart startup
    ... we MIS folks are required to take on tasks that we don't ... developer, nor the database. ... Why do you need MySQL?. ... in size that KTP experienced, evolving to the current 90,000+ sq. ...
    (comp.databases.pick)