Dean, Thanks for you reply.
You are almost correct in our system layout but the MySQL database server is on a seperate machine (currently running Windows 2000 AS with all the databases on a separate drive and soon to be updated to Linux). The inserts would need to take place over the network to the MySQL server, which from what Gerald has helped me with, seems like we only need to put the hostname in when we call the MySQL server verses having it insert locally. This still leaves one real question and that is, which client do I need to use on the SCO 5.2 machine? If we install the older 3.2 (already compiled) version of MySQL on the UNIX machine, can it talk to the newer 4.** server located on the other machine. It's going to complete a simple insert statement. If not, I guess we will need to compile our own. As far as the programming language that the UNIX is using, I will have to talk to my UNIX programmer. The Windows machines used for processing the shipments work just right using the MyODBC connection. I have converted our old Access databases over to MySQL and everything works like a dream there. It's just a matter of getting the UNIX machine that processes all of our orders to dump the data to the MySQL database instead of inserting it into the text file so that everything is tied together. Thanks again, Chris -----Original Message----- From: Grimes, Dean [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 03, 2002 8:01 AM To: Chris Couture Subject: RE: Need Driver to connect Unix SCO 5.2 Open Server to MySQL DB? Chris, If I understood you correctly, you have a Unix server that creates text string when an invoice is processed. That string of data is to be inserted into the MySQL database. Then you have a Windows application that needs to be able to retrieve that data from the MySQL database that resides on the Unix server. If that is stated correctly, then I am assuming that MySQL and the invoice processor are running on the same Unix server. If that is the case, it should be easy enough for your programmer to insert that data directly into MySQL. There are a couple of different methods that will work. 1. You could write a shell script that your invoice processor would call each time a record needs to be inserted. The data would be passed as parameters to the shell script. The shell script would use the MySQL client to perform the insert. There is some overhead associated with this method but you are only inserting about 2500 records a month. Which translates to only 84 inserts a day. This is very low traffic and your system should handle it no problem. Example script: #!/bin/ksh # Insert into mysql database mysql -s << % insert into table_name (col1,col2,col3,col4) values("$1","$2","$3","$4"); % This script is not checking for any errors. The completion status should be returned to the calling program for obvious reasons. Of course this assumes that the user_id that the invoice processing program is running as has grants in the mysql.user table with insert privileges. The invoice processing program would have a system call like: system("/path/to/script/insert_to_mysql arg1 arg2 arg3 arg4") or some such call as that. That is the easiest method to putting data into mysql. 2. Depending on the language your invoice processor is written in, you could talk directly to MySQL. This is the preferred method. I would need more information about your invoice processing program to more accurately provide examples. As to your Windows app. MyODBC works just fine. We use it here and have had no problems with it. ODBC is going to be slower than a direct connect, but again we're talking a very low amount of traffic. You should have no problems. Dean -----Original Message----- From: Chris Couture [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 02, 2002 8:36 PM To: [EMAIL PROTECTED] Subject: RE: Need Driver to connect Unix SCO 5.2 Open Server to MySQL DB? Thanks again for the help! I tried this on my local machine and it worked like a champ. Here is the question that my unix software programmer has: "I believe the "client" end would be a unix ODBC, which mysql has an SCO version, but it says you need iODBC (or uODBC - I can't remember which), but they don't have a compiled version for SCO. So we would need the gcc compiler and then compile it. That throws a whole other wrench into it as I don't want to be responsible in trying to figure why it won't compile - if there is a problem. The easiest thing might be to install a full version of MySQL on the SCO machine. That should include the client. So then we could write to the other server (or the SCO server if for some reason we need to). The neato advantage to this is for new software. The software I am currently writing is Windows client with SQL Server 2000. I could change it so it uses MySQL and then the data server could continue to be the SCO machine for security purposes. Pose the question to the list that: If I load a full version of MySQL on SCO OpenServer 5.2, does that include a client so I could write to both a linux machine running MySQL or the SCO machine just by changing the INSERT statement? If so, that would be the easiest since MySQL has a compiled binary for SCO (I looked at 3.2 - last stable version - I didn't check the 4.03 max." So this brings up this question from me: I am using MySQL version 4.0.3max right now so lets say that we installed version 3.2 on the UNIX machine, could the older client talk to the 4.0* versions of the MySQL server or should we try to keep them the same? It will be only for simple insert statements and maybe simple selects in the future. Thanks again for the help. Chris -----Original Message----- From: gerald_clark [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 02, 2002 9:12 AM To: Chris Couture Cc: [EMAIL PROTECTED] Subject: Re: Need Driver to connect Unix SCO 5.2 Open Server to MySQL DB? Chris Couture wrote: >Thanks for the info. Let me see if I have this right. > >(I am asking these question on behalf of my UNIX programmer who will be >doing all of the programming so sorry if I am asking simple questions.) > >To make this simple, let's label the computers. The MySQL database >server will be labeled "B" and the UNIX machine doing the inserts will >be "A" > >This is what I understand so far. I install the client on "A" and it >can then talk to the mysqld server on "B"? How do I need to go about >telling "A" where the mysql server is located? Is this something I can >set up in a ini file or does it need to be in the scripts that are ran >to do the inserts (like a php or asp script does). My UNIX guy asked me >to ask about an ODBC connector. Will MyODBC work on Unix? > mysql -h hostname -u username -p databasename will connect the mysql client to the derver on hostname. In PHP and perl, there are connection routines that will include the hostname. Use ODBC only if there is no other connection method available. Tell your UNIX guy to check out mysql.com. > >Thanks so much for the help! > >Chris > You are welcome. > >-----Original Message----- >From: gerald_clark [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, October 01, 2002 3:16 PM >To: Chris Couture >Cc: [EMAIL PROTECTED] >Subject: Re: Need Driver to connect Unix SCO 5.2 Open Server to MySQL >DB? > >You need the client 'mysql' on the unix machine to talk to the >server 'mysqld' on whatever machine. >This will allow you to write shell scripts that call mysql. > >If you want to program in PHP or perl, then you need their >mysql drivers which talk to the server. > >Chris Couture wrote: > > > >>Hi, >> >>I'm a MySQL Newbie and am working on my first real project. The >> >> >project > > >>involves removing the Access database off of our system and using MySQL >>in its place. Here is what happens now with this database.... >> >>The Unix machine writes information to the end of a text file every >> >> >time > > >>an invoice is processed. This text file is FTP'd every 10 minutes over >>to our server. Access starts up and querys all the data and puts it >>into the proper tables. (Currently there are 15,000+ records and this >>has only been running for 6 months so you can see the need to rethink >>this process.) >> >>This process allows our shipping computers, using OBDC to connect to >> >> >the > > >>access database where they can pull the information into the fields >>(name, address, service type etc) >> >>Anyway, here is where I stand now. I have built the MySQL server and >> >> >it > > >>has been up and running for 3 weeks now and seems stable. I have >>installed MyODBC on the shipping computers and they connect. My >>question is what type of driver do I need to put on the Unix machine to >>make it where it can write insert statements directly to the database? >> >>Thanks, >> >>Chris >> >>--------------------------------------------------------------------- >>Before posting, please check: >> http://www.mysql.com/manual.php (the manual) >> http://lists.mysql.com/ (the list archive) >> >>To request this thread, e-mail <[EMAIL PROTECTED]> >>To unsubscribe, e-mail >> >> ><[EMAIL PROTECTED]> > > >>Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php >> >> >> >> >> >> > > > >--------------------------------------------------------------------- >Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > >To request this thread, e-mail <[EMAIL PROTECTED]> >To unsubscribe, e-mail <[EMAIL PROTECTED]> >Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > > > --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php