Butterbean Posted December 29, 2014 Share Posted December 29, 2014 When I set up MS SQL on my machine, for whatever reason I did not set up a UID or password. I can not get the php to connect with SQL because I do not have a UID and password on the db (which I know is not smart). I don't understand code enough to know how to manipulate this string below to remove the requirement. Ultimately, the other approach would be to go back and add a Username and Password to the MS SQL Db but that seems to be a feat also. Any help getting past this small hurdle would be appreciated. It is set up as a db engine. $serverName = "BASEMENT\SQLEXPRESS"; //serverName\instanceName $connectionInfo = array( "Database"=>"aaaaaaa", "UID"=>"bb", "PWD"=>"cccccccc"); $conn = sqlsrv_connect( $serverName, $connectionInfo); Thank you in advance. Quote Link to comment https://forums.phpfreaks.com/topic/293461-set-up-my-database-with-no-uid-or-password/ Share on other sites More sharing options...
Jacques1 Posted December 29, 2014 Share Posted December 29, 2014 So you don't have 5 minutes to fix the account, but you do have all the time in the word to try out workarounds which you already know are stupid? Check your priorities. Quote Link to comment https://forums.phpfreaks.com/topic/293461-set-up-my-database-with-no-uid-or-password/#findComment-1500998 Share on other sites More sharing options...
Butterbean Posted January 8, 2015 Author Share Posted January 8, 2015 If I knew at the time how to fix the account, I wouldn't be in here getting reprimanded by someone that obviously doesn't know the answer to the question and wouldn't provide an answer if he did!!! So, if you have nothing better to say, move along and mind your business please. Thank you. Check yourself at the door! Quote Link to comment https://forums.phpfreaks.com/topic/293461-set-up-my-database-with-no-uid-or-password/#findComment-1502087 Share on other sites More sharing options...
requinix Posted January 8, 2015 Share Posted January 8, 2015 Does leaving the UID and PWD empty work? Completely removing them from the array? But you really should set a username and password on the server. Quote Link to comment https://forums.phpfreaks.com/topic/293461-set-up-my-database-with-no-uid-or-password/#findComment-1502095 Share on other sites More sharing options...
Butterbean Posted January 11, 2015 Author Share Posted January 11, 2015 I figured it out. There was a bug with MSSQL2008R2 that prevented it. No matter how many times I tried to uninstall and reinstall it, it never created a database. This was easily fixed by downloading 2014. The PHP was written with a login and password and connected to my work db. When I tried to set up a home instance, for development, I couldnt get it work with having the pw's set up. The work around was to just remove the username and password from the code, but I couldnt never figure out how. Quote Link to comment https://forums.phpfreaks.com/topic/293461-set-up-my-database-with-no-uid-or-password/#findComment-1502478 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.