Subscribe to RSS
Company Giving Back Brand Guide. Store Login. Forums New posts Trending Search forums. What's new New posts New resources Latest activity.
Resources Latest reviews Search resources. Feature Requests. Log in.
Search Everywhere Threads This forum This thread. Search titles only. Search Advanced search….How to allow remote connections to SQL Server Express
I could have sworn that SQL Server would be listening toand perhaps it is for certain protocols. However, this nice little program informed me I was completely wrong. Show hidden low quality content. You must log in or register to reply here.
Why EE? Courses Ask.
Get Access. Log In. Web Dev. We help IT Professionals succeed at work. Last Modified: Start Free Trial. View Solution Only. Commented: You've entered your username, password or hostname incorrectly. Check your details and try again. You might also need to connect to a specific port. Author Commented: This is my code. The same script I get from the server to my local computer but there is no such message coming out in the server. There is no problem connect to the local DB, all the data from the DB able to pull out when served the php file.
But there is a message showing out on the PHP file. Unlock this solution and get a sample of our free trial. I got the newest version of ntwdblib. The user is not associated with a trusted SQL Server connection. Get your personalized solution. Ask The Experts. Unlock the solution to this question. Thanks for using Experts Exchange.
If someone encounters the interesting problem in which PHP can connect to a MSSQL server from the command line but not when running as an Apache module: SELinux prevents Apache and therefore all Apache modules from making remote connections by default. If you already have those installed but it doesn't seem to be connecting, the one possibility is that you are being blocked by SELinux.
Check your php. If you want to use specific credentials from a PHP script, then set mssql. An instance is nothing more than specific port address different than There are couple of thing you need do.
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to ser
There's no needs to install SQL client software in your app server. This would keep your server clean. It's not most current. The version I'm using is: 8. And make sure you put this file in your system32 folder.
If you add Windows users or groups to SQL security logins and try connecting using that login the connection will fail. If the connection works for SA but not for your login, this may be your answer it was for me! For those trying to connect PHP 5. System DNS 3.
I was trying to connect to a remote SQL server located on Internet, not on the local networkthen php always returned an "Unable to connect" error or something. I was monitoring the TCP connections between the server and my machine when I realized that it wasn't been done.
For some reason, my Apache 2. So I changed the php configuration on apache to CGI mode rather than as module mode. Well, it worked fine since that. In despite of security holes that it involves, it was the only way I've found to make that remote connection works between Apache2.
Strangely, connections inside local network worked in any case in CGI or module mode. Later, however, I discovered my problem was a mismatched name in the server table.
If the srvname, and datasource don't match the cluster's virtual SQL name After running these 2 procedures, restart the server and PHP should connect just fine using the native libraries. If it still doesn't connect, make sure you update the ntwdblib.
Execute following statement after connection to DB.I am running on a Linux server. I followed the following steps. After all this, and even after completely restarting the server itself, still no dice. I'm probably doing something completely wrong, so my apologies again.
That's good info, but as a beginner, I'm a bit clueless on how to re-compile the installed PHP. I've read up on it, and it seems I need to run the "configure" file in the PHP directory, but oddly enough, I am not finding a PHP directory or a "configure" file anywhere on my newly setup server GoDaddy virtual dedicated serveroutside of the FreeTDS directory. I'm worried sick that I'm going to mess up something here and trash all my PHP abilities, lol.
What flavour of linux are you using? You may find it alot easier to use the package manager e. I'm not entirely sure that many Linux distros that bundle PHP include the mssql libraries, as the mssql database only runs on Windows.
Are you sure you didn't mean to use the mysql functions? That's great to hear that there may be other options outside of FreeTDS, as I'm not married to it in any way. Whatever the most simple solution is, I'd love to find it and go with it. Thank you all again for any help you can offer! There is certainly one for Debianwhich is the distro we use. I am not so sure about the others. A quick update. I setup my odbc.
I cannot seem to get anywhere with this. Are there any additional steps I need to take in order to ensure that PHP knows to look in the same place that isql is looking for the DataSource and Driver? Everything appears to be setup properly on the backend.Score: 4. View Add Comment Developer Edit. We've had this issue on PHP 4. We are using Apache 1. Our database is Microsoft SQL sp3. It is running on the server above. Our development server is also running Windows with Apache 1. It will produce the same error under heavy load connecting to the SQL database on the production server.
This tells me the SQL server can be local or remote and still have this problem. I would say this is a PHP problem, except that it stays stable and only severely degrades when the SQL server is under stress. So it was buggy but easily worked around. Yesterday the entire system fell apart on me. Constant failover to where it wasn't connecting.
Hence this bug report. Our system is a web interface project management system for techs in the field that has about 15 people at any given time interacting with it. The SQL server itself runs this system and three reporting systems as well. What gets me is that it will instantly return the message: "Unable to connect If anyone can get me information on how to help out on fixing this extension issue, email me! Because I'm more than willing to drop my time into this problem.
The default value is So what does that mean; processes? Is a process a single SQL connection? Or is it all events running through mssql? Or is a process a single user requesting thru Apache? We only have 30 employees in our company and there's never an instance where all 30 would be creating a SQL connection at the same time.
Learn more. Asked 6 years, 11 months ago. Active 3 years, 4 months ago. Viewed 33k times. Fakhruddin Ujjainwala 2, 14 14 silver badges 25 25 bronze badges. Ehphan Ehphan 3 3 gold badges 5 5 silver badges 18 18 bronze badges. I did that and it shows blank!!
Troubleshoot connecting to the SQL Server Database Engine
Active Oldest Votes. Mihai Mihai Maybe this information could be helpful to others Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password.
Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast is Scrum making you a worse engineer? The Overflow Goodwill hunting. Upcoming Events. Featured on Meta.Skip to main content. Select Product Version.
All Products. Each user has a default database. When you connect to computer that's running Microsoft SQL Server, and you do not specify a login database, the default database is used. However, if the default database is unavailable at the time of the connection, you may not be able to connect. The user default database is unavailable at the time of connection. It's possible that the database: Is in suspect mode. No longer exists.
Is in single user mode and the only available connection is already being used by someone or something else. Has been detached. Is offline. Is set to emergency status. Does not have the login account mapped to a user, or the user has been denied access. Is part of a database mirror. Additionally, the login account may be a member of multiple groups, and the default database for one of those groups is unavailable at the time of connection.
To work around this behavior, specify a valid, available database in the connection string. To prevent the error when the user's default database is unavailable, log on as a user who can modify logins. Then, change the user's default database to a database that's currently available for a connection. You can use the sqlcmd utility to change the default database in SQL Server To do this, follow these steps:.