Cant connect MSSQL2K5 via PHP from local and remote

Newbie Spellweaver
Joined
Dec 14, 2007
Messages
25
Reaction score
0
Installed MSSQL2K5 Express Edition.
Added new login and password.
All was OK, I could login from local with using "SQL Server Management Studio Express"

I reseted computer than tried to login and there was erorr than I cannot connect from remote computer, but I was trying to login from localhost by Management Studio.
I just did some things from MSDN with enabling remote etc and I repaired it, all was same as before reset.

I wanted to login to my server from LAN remote computer and it works, but I cant connect only by using IP of MSSQL server I must use this type:
<CommputerName>\SQLEXPRESS
or
<xxx.xxx.xxx.xxx>\SQLEXPRESS
Where xxx its IP.

I dont how to connect from local or remote IP to my SQL server:
PHP:
mssql_connect("localhost", "login", "password");
mssql_connect("localhost");
It dont works.
localhost\SQLEXPRESS dont work too.

What I need to config?
Here is screen from my connection config in MSSQL 2005.
Vaxieus - Cant connect MSSQL2K5 via PHP from local and remote - RaGEZONE Forums


Do I need to setup Aliases or something?
 
If u using xampp copy it to the following locations:
a) xampp\php\
b) xampp\Apache2\bin\
c) windows\system32\



If you still have problems with connecting use ".\SQLEXPRESS" NOT localhost or 127.0.0.1 ...

After that restart mssql and apache ;) have fun.
 
Upvote 0
It really works, thanks ;)
Tried from another computer on my LAN and I could connect with:
192.168.0.xxx\SQLEXPRESS easily.

Hmm now got another question.
What I can do on this config which screen is in my post above?
I see there IP1, IP2, IP_ALL.
What is this? Setting up, what remote computer can connect to my SQL?
What is the difference between Enabled and Active?
What is the difference between TCP Dynamic Port and TCP Port?
What I can declare in IP_ALL?

EDIT:
I am not sure, I've found out that I am declaring here IP's and ports listened on that IP, but it dont works good for me.
When I set 0 on Dynamic Port on IP_ALL, then I can connect from remote computer.
When I leave blank I can't.

When I leave it blank then set on IP1 (IP of server network card), then set port 1433. I still can not connect to my server from remote.

PROBLEM ABOVE IS NOT ACTUALLY ALREADY ;).
 
Last edited:
Upvote 0
I have next problem with MSSQL.
I've made new database and tabel in this db.
I made some char(50), nchar(50), smalldates and one int for ID and gave him Primary Key, all NOT NULLS.

How to make auto increment for ID Primary Key?
Everytime when I want to add record there is problem with key, beacuse I need to increment him manually or write PHP code (worthless).

What about small date?
In MySQL you could give 0 to date and MySQL automatically pasted new date, how its here?

EDIT:
Solved problem with primary Key.
Dates still undiscovered
 
Upvote 0
Back