[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Marcin Tyman

7/26/2007 11:47:00 AM

Hi,
How to operate on MySQL? I would like to delete, create database and
upgrade with prepared files. I know mysql library but I'm not sure
whether it let me operate on commands such as delete database, source
file_path etc.

I will be appreciated for any help

MT
--
Posted via http://www.ruby-....

5 Answers

Ronald Fischer

7/26/2007 12:08:00 PM

0

> I would like to delete, create database and
> upgrade with prepared files. I know mysql library but I'm not sure
> whether it let me operate on commands such as delete database, source
> file_path etc.

If you connect with administrator privileges, you should be able
to execute any command you could also execute from the mysql
command line interface.

Ronald
--
Ronald Fischer <ronald.fischer@venyon.com>
Phone: +49-89-452133-162

Marcin Tyman

7/26/2007 12:25:00 PM

0

Ronald Fischer wrote:
>> I would like to delete, create database and
>> upgrade with prepared files. I know mysql library but I'm not sure
>> whether it let me operate on commands such as delete database, source
>> file_path etc.
>
> If you connect with administrator privileges, you should be able
> to execute any command you could also execute from the mysql
> command line interface.
>
> Ronald

dbh.query("source c:/create.sql") - doesn't work. It causes SQL syntax.
--
Posted via http://www.ruby-....

Ronald Fischer

7/26/2007 12:45:00 PM

0

> dbh.query("source c:/create.sql") - doesn't work. It causes
> SQL syntax.

True, but for this case, you can always do

IO.readlines("c:/create.sql").each { |s| dbh.query(s) }

Ronald
--
Ronald Fischer <ronald.fischer@venyon.com>
Phone: +49-89-452133-162

Marcin Tyman

7/26/2007 12:52:00 PM

0

Ronald Fischer wrote:
>> dbh.query("source c:/create.sql") - doesn't work. It causes
>> SQL syntax.
>
> True, but for this case, you can always do
>
> IO.readlines("c:/create.sql").each { |s| dbh.query(s) }
>
> Ronald


Thanks, I'll check it. It seems to be ok. At the moment I cannot check
it (the db is used)

--
Posted via http://www.ruby-....

Ari Brown

7/26/2007 2:23:00 PM

0


On Jul 26, 2007, at 7:47 AM, Marcin Tyman wrote:

> Hi,
> How to operate on MySQL? I would like to delete, create database and
> upgrade with prepared files. I know mysql library but I'm not sure
> whether it let me operate on commands such as delete database, source
> file_path etc.
>
> I will be appreciated for any help


You can use Ruby/MySQL, MySQL/Ruby, DBI, or ActiveRecord

~ Ari
English is like a pseudo-random number generator - there are a
bajillion rules to it, but nobody cares.