Creating MySQL Databases

Peter Reid preid at reidit.co.uk
Sun Mar 20 19:05:12 EST 2005


>Peter,
>
>I recommend that you check your SQL database documentation for there 
>are SQL function for creating databases and stuff like that. 
>phpMyAdmin does nothing but serve as front-end for the MySQL system, 
>all it does is to pipe commands to the server. I'll sum some URLs 
>below that point to good parts of documentation where you can find 
>what you need:
>
>http://dev.mysql.com/doc/mysql/en/database-use.html    -- This will 
>show how to inspect your databases and how to "start using" them.
>
>http://dev.mysql.com/doc/mysql/en/creating-database.html   -- This 
>presents the commands to create a database.
>
>http://dev.mysql.com/doc/mysql/en/loading-tables.html  -- this is 
>just a "cool" thing to load "raw text files" in your database.
>
>http://dev.mysql.com/doc/mysql/en/backup.html  -- this will cover 
>your desires for dumping and restoring :D
>
>Sorry but I did not find anything on renaming databases... but you 
>can dump them, change the SQL with a simple replace "oldname" with 
>"newname" in the SQLConteainer then, execute that SQL, then delete 
>the old database, it will solve your problem....
>
>Also if you're fiddling with SQL and Rev, check Trevor's 
>libDatabase, it's an amazing lib.
>
>Cheers
>andre

Andre

Thanks for the response and the links.

I realise that I can do all I want directly through a command 
interface and that phpMyAdmin simply takes advantage of the features 
built into MySQL.  What I can't see is how I can encapsulate this 
into a Rev program, particularly one that will be running on a system 
that is NOT the host for the MySQL server but on the same local 
network.

If my Rev program were running on the system acting as the MySQL 
server host, then I could use the shell() function controlling the 
MySQL server in command line mode.  However, my program will not be 
on the same system, so I don't see how I can build this into the 
program?

It seems that the Rev support for SQL databases assumes that 
databases are pre-existing and managed externally. Rev seems to 
provide all the commands you need to read from and update SQL 
databases, but not the commands to create and manage them.

On the "renaming" front, I had assumed that phpMyAdmin did a dump & 
reload with new name to accomplish this.  as you say, database 
renaming doesn't seem to be a native feature of MySQL (and several 
other SQL databases I believe).

You mention Trevor's libDatabase - where can I get hold of this, it 
could be very helpful?

Cheers

Peter
-- 
Peter Reid
Reid-IT Limited, Loughborough, Leics., UK
E-mail: preid at reidit.co.uk


More information about the use-livecode mailing list