LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-30-2011, 05:03 PM   #1
jetman5312
LQ Newbie
 
Registered: Mar 2011
Posts: 2

Rep: Reputation: 0
Mssql_connect error


I'm trying to read our companies mssql ordertracking db using php's mssql_connect. I was able to make this work when using WAMP, and I had done so by adding the same user on both machines and then applying that user name to the WAMP service. Because of viruses and poor performance... I moved the site over to ubuntu server... and I have to say i am very pleased, other than I cannot make a connection to mssql now. I installed sybase5 and can see mssql is available via phpinfo. It's using freetds. I know all my connection info is correct. I can ping the machine that has mssql from the new webserver. When i try to view a test php connection page it returns nothing but a null response, and my error log just says ERROR with no specific info. I did however find out that /tmp/freetds.log returns a bunch of jibberish.

this forum isn't letting me submit the whole log, so i put it on sendspace here
http://www.sendspace.com/file/a2dt3s

I did jack around with odbc_connect but still couldn't get it to work... I feel like I am close with mssql_connect but there is some user authentication problem. If anyone can offer up any helpful info on some trouble shooting or something to find out why it won't return any info from the mssql db i would appreciate it. Also I was wondering if something similar can be done with ubuntu where i applied a user to the WAMP service on my windows machine which then was able to connect to the mssql db. Anyways... I've been trying for a few days now, and really need some help. Thanks!
 
Old 04-26-2011, 12:31 PM   #2
SaladOfDoom
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Rep: Reputation: 0
I can't download your log without paying, so I'll ask:
I looks like you're trying to switch from windows authentication to user authentication, does your MSSQL server allow that, and did you add the username and password to the connection string?
 
Old 04-27-2011, 01:06 PM   #3
jetman5312
LQ Newbie
 
Registered: Mar 2011
Posts: 2

Original Poster
Rep: Reputation: 0
I thought sendspace just let you download it from the link. Anyways... i'm new to doing some of this stuff ...The SQL server that is on a windows server 2003 OS... is using Mixed authentication. It was easy to connect when it was 2 computers both using windows.

Now that i'm using ubuntu server to connect to server 2003... I'm having to manually enter in on the ubuntu side lots of values and specifying the location of drivers inside several different config files. I was specifically dealing with ODBC and freetds.

I found an alternative to using mssql connect function for php/apache, and it was something called PDO. I used these two links to get started on using PDO to connect to our companies mssql db.

https://secure.kitserve.org.uk/conte...bc-and-freetds

http://net.tutsplus.com/tutorials/ph...tabase-access/

I still wouldn't mind learning to create a connection using mssql_connect(), but because of pressure from the company to get it done ASAP i used PDO. Which seems to work just fine... HOWEVER... i realized if i had some really heavy SQL queries with lots of joins... it would freak out(they were valid queries because they would return records in SQL EXPRESS). The way I got around that was doing several small queries and opening and closing connections with all kinds of different arrays storing the values and it looks messy and was a pain. It was ugly but it got the job done.

Anyways... if you have any good resources on setting up a linux apache web server connecting to a mssql db i would certainly take a look at it and try it out. I already feel like a scoured the internet looking for good resources on it. I really feel like I was close but because i'm novice in dealing with linux I was doing something wrong in the config files that wasn't allowing everything to work properly.
 
Old 04-28-2011, 01:17 PM   #4
SaladOfDoom
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Rep: Reputation: 0
I'm afraid I can't help you with the linux configuration, my experience is from the windows side, but I know that changing the authentication from windows user to SQL user authentication can be tricky.
Another possibile issue can be that you need a compatible network protocol configured for the server and client. My guess is that the linux box would need TCP/IP, while windows may default to named pipes or something.
If you still have the windows box available, you could do the authentication switch and the client network configuration change on the working setup to be changing things one at a time and be sure you have the right strings, anyway.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Google-Chrome Error (Error 9 (net::ERR_UNEXPECTED): Unknown error) smoooth103 Slackware 4 12-04-2010 08:42 PM
[SOLVED] php5 ./configure error: (FILENAME=- FNR=27) fatal error: internal error richinsc Linux - Software 2 07-08-2010 10:20 AM
Memory error: extended error chipkill ecc error rajivdp Linux - Hardware 1 12-07-2009 09:26 AM
Sendmail: eocket wedge , 504 error , dsn error, mail relay connection error djcs Debian 0 03-03-2009 01:41 AM
Suse CUPS error: cups(File)DoRequest error:client-error-bad-request smdonelan Linux - Hardware 6 04-17-2007 07:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration