Listing available MYSQL databases
Ken Ray
kray at sonsothunder.com
Sat May 29 09:36:26 EDT 2010
Actually, it's even easier than that:
put "/usr/local/mysql/bin/mysql -u username -p password --execute='show
databases'" into tCmd
put shell(tCmd)
The only minor downside is to get the TRUE list, you need to clean up the
result a bit (the first line just says "Database" and the last line is
empty). So you can simply do this in one statement (indented here for
clarity):
put line 2 to -1 of shell("/usr/local/mysql/bin/mysql -u username -p
password --execute='show databases'") into tDBList
Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/
On 5/25/10 10:42 PM, "Bob Cole" <bobcole at earthlink.net> wrote:
> If you put "SHOW DATABASES;" in a text file on the target
> machine then you can execute the following statements
> (watch for line breaks):
> put "/usr/local/mysql/bin/mysql -u username -ppassword <
> '/usr/local/ShowDatabases.txt'" into myCommand
> put shell(myCommand) into message box
> That works for me on my Mac with OS X 10.6.3
> Bob
>
>
> Tue, 25 May 2010 11:41:21 -0700, Glen Bojsza <gbojsza at gmail.com> wrote:
> HI Joe,
> You are correct and this has help solve my problem.
> regards,
> Glen
>
> On Tue, May 25, 2010 at 10:32 AM, Joe F. <joef1 at mac.com> wrote:
>> This script would make promysql evaluate to "mysqlshow - u nrl -pnrl1"
>> On May 23, 2010, at 3:36 PM, Glen Bojsza wrote:
>>
>>> Hello,
>>> Has anyone successfully used either "open process" or "get shell()" to list
>>> the databases available on a machine.
> [...snip...]
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list