[Gambas-user] Database Access

neil lewis neil at ...233...
Mon Feb 20 11:12:02 CET 2006


Hi Llew,

Hope I can provide some help here.

First, it's good that you have given examples of how you have set up
databases for use with your previous Delphi programs, because that
immediately points to the cause of some of your problems.

I take it from your post that you are new to Linux as a whole, so I can
understand your confusion. Mostly, the problem for newbies is the
realisation that Linux is desiged from the ground up as a networked
system and so almost all services in Linux are run on a client/server
basis. This is true for things as diverse as the X-server (graphics
system), ALSA (sound) and yes, databases such as MySQL/PostgreSQL. You
first have to have a running server before you can connect a client to
it. Obviously, this is a little more complex to set up than a simpler
system which assumes that everything you need is located on your own PC,
but the huge advantage is that no assumptions are made about the
physical locations of the server or client. Once set up, the system will
work just as well on a one PC as it will on a LAN, WAN or indeed the
Internet and the actual physical arrangement will be transparent in most
cases.

Sorry to go on a bit about this, but it's pretty fundamental to
understanding why Linux so often does stuff differently to Windows.

Having got that out of the way, some of your problems should now make
sense. First, you must install, configure and start a (for example)
MySQL database server. This can be on te same PC you want to use as the
client. With that going, you can create a database on the server. (I'd
suggest that you also install phpMyAdmin as it's probably the easiest
way to administer a MySQL server, inbcluding adding databases, adding
and manipulating tables and handling backup/restore of data among other
functions. You say you already have php installed, so I guess you also
already have a web server (eg Apache.) installed and working. These will
be needed to use phpMyAdmin.) When you install MySQL you will need to
run a couple of console commands to set up the initial access
permissions for the root user. Your ditribution should provde details.
If not, either check the (excellent) documentation on the MySQL web site
or let me know if you have a problem.

With your MySQL server functioning and a database created, you are ready
to make a connectin to it from Gambas or any other program which
supports MySQL connections.
The Host is the address of the computer where the MySQL server is
located. (or it's name if you have added it to your /etc/hosts file or
have a nameserver running)
The user is the MySQL user name you have specified in your MySQL
configuration as having rights to access the database in question.
The password is the MySQL password associated with the MySQL user, also
specified in the configuration.

All the above settings can be configured easily from the phpMyAdmin
interface if you are unused to a command line envirnment.

Once you put the correct into into the connection dialog, you should
connect with no problems.

I'm sure al of the above sounds horrendous - I know it did to me as a
newbie a couple of years ago - but honestly, once you have MySQL working
it's realy very easy to use, very powerful and very fast. Not only that,
but if you later get into web database applications such as dynamic
websites, then you will quickly discover that not only do most hosts
provide MySQL databases, but most of them also use badged versions of
phpMyAdmin for user administration.

All the best,

Neil Lewis (photobod), London.


Llew Ashdown wrote:
> johnf wrote:
>> On Sunday 19 February 2006 22:11, Llew Ashdown wrote:
>>   
>>> Hi everyone,
>>> Can anyone point me in the right direction please, ( I don't have a clue).
>>> I am a long standing Delphi programmer - and have written lots of quite
>>> sizable applications, but I actually quite dislike the operating system
>>> upon which it runs.
>>> I would love to be able to do as much on Xandros , but I think that is a
>>> /long way off./
>>>
>>> Gambas looks like it is headed in the right direction, but I am having
>>> hells own trouble getting my head around database connection of any
>>> kind- mysql or whatever.
>>> ( I had more than a little trouble getting Gambas 1.9.24 to work on
>>> Xandros- but it is up and running)
>>> Thinking that it might help I installed XAMPP php,perl,mysql, etc --
>>> But I am - still in the dark - any connections I try just fail-- sorry
>>> to be so thick.
>>>     
>> Show us your code.  Maybe we can then help.  Also take a look at the database 
>> example.
>> John
>>
>> That's one of the problems, the (Database) example won't even work.
>>   
> The problem is much lower down than you are thinking-- I don't have
> any code.
> IE in delphi (or dbisam) a *database* is just any directory.
> a table is any dbisam table within that directory.(so simple)no user
> no password.
> I simply create that table or those tables within that directory and
> point the components to it -- done.
>
> Just what is supposed to go in these boxes ?
> Image of Data setup
>
> Type (I can Sellect) Ok----
> What is Host? (  I have Tried http://localhost) to no effect
> What is Database? (Is this simply a directory, and if so which one
> will work for mysql -- an so on)
> I am not even sure if I need to specify myself as user or some linux
> default.
> And can I use any password.( I imagine so )
> very sorry ----
> I did say I know *nothing* -- I cannot get the first toe in the water.
>
> I am not having any trouble with most other things about Gambas, in
> fact it all appears to work great.
>
> Thanks again.
>
>
>
>
>
>> -------------------------------------------------------
>> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
>> for problems?  Stop!  Download the new AJAX search engine that makes
>> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
>>   
>
>
> -- 
> Regards
>
> Llew Ashdown
>   




More information about the User mailing list