I need help setting up SQL Server Express edition.
What I did so far:
1) Downloaded and installed it with windows authentication
2) Installed SQL Server Management Studio Express
3) Created a database
4) Realized I needed SQL Authentication for connecting via php page.
5) Followed these instructions to enable SQL Authentication
Now that SQL Authentication is enabled, how do I create a user account that I can use in php pages to connect to the database?
Thanks,
Kurt
Hey Kurt. See the documentation in Books Online for the following commands:
CREATE LOGIN
CREATE USER
The create login statement will create a user on your server, then run the create user statement to allow that user access to the database(s) on your system.
HTH,
|||Hello,Ok thanks, I got my user created with the following. I also realized its the same as creating a user in SQL Management Studio Express.
sqlcmd -S .\SQLEXPRESS
1>CREATE LOGIN myuser WITH PASSWORD = 'mypassword';
2>GO
Is there anything else I have to change for php to beable to connect with this user?
Thanks,
Kurt|||
You need to run the CREATE USER command to give the login you just created access to the database(s) you want it to have access to. Then you have to provide the appropriate permissions to that user within the database in question (i.e. select from tables, update tables, delete tables and records, etc., etc.)
|||Hi Chad,I keep getting an error when I try to connect from a webpage. For the server can I use localhost?
Warning: mssql_connect(): Unable to connect to server: localhost in D:\wwwRoot\db\connect.php on line 18
Thanks,
Kurt
No comments:
Post a Comment