TLawrence Posted December 12, 2008 Share Posted December 12, 2008 I have a client who just recently started receiving the following error. "Warning: mssql_connect() [function.mssql-connect.html]: message: Cannot open user default database. Using master database instead. (severity 11) in filename on line 2" According to them, nothing has changed regarding their database, so what would typically cause this error to occur? This is the first project I've done using MSSQL, so I'm not that familiar with the database software and I've never seen this error before. Quote Link to comment https://forums.phpfreaks.com/topic/136713-solved-cannot-open-user-default-database-using-master-database-instead/ Share on other sites More sharing options...
rhodesa Posted December 12, 2008 Share Posted December 12, 2008 it means the default database for the user you are connecting with doesn't exist or you don't have permission to access it Quote Link to comment https://forums.phpfreaks.com/topic/136713-solved-cannot-open-user-default-database-using-master-database-instead/#findComment-713914 Share on other sites More sharing options...
TLawrence Posted December 12, 2008 Author Share Posted December 12, 2008 So more than likely something DID change on the client's side regarding the database, even though they're telling me nothing changed? Can you explain the difference between a default database and master database? What are their purposes and when/how are they created? Wouldn't their IT person know if a default database no longer existed (db dropped)? Or if permissions changed? Quote Link to comment https://forums.phpfreaks.com/topic/136713-solved-cannot-open-user-default-database-using-master-database-instead/#findComment-713952 Share on other sites More sharing options...
rhodesa Posted December 12, 2008 Share Posted December 12, 2008 the master database is just the general system database that mssql needs. ask the IT team what your default DB is set to also, after you get the warning, can you select your DB, and query your data ok? if so, just put an @ in front of the function and ignore the warning. while it is good to fix it, it won't hurt to have a bad default db Quote Link to comment https://forums.phpfreaks.com/topic/136713-solved-cannot-open-user-default-database-using-master-database-instead/#findComment-713955 Share on other sites More sharing options...
TLawrence Posted December 12, 2008 Author Share Posted December 12, 2008 You bring up a good point. If the warning isn't harming anything, than just ignore it. I know that's not good practice, but it's a good temporary fix until we figure out the real problem. Thanks for the help! Quote Link to comment https://forums.phpfreaks.com/topic/136713-solved-cannot-open-user-default-database-using-master-database-instead/#findComment-713979 Share on other sites More sharing options...
rhodesa Posted December 12, 2008 Share Posted December 12, 2008 do you have the MSSQL Management Studio? you should be able to connect with that and look up your default db. once in the management studo, and connected to your server, expand the 'Security' section, then the 'Logins' section. right click on your account and select 'Properties'. the default db will be on the main page that comes up. Quote Link to comment https://forums.phpfreaks.com/topic/136713-solved-cannot-open-user-default-database-using-master-database-instead/#findComment-713981 Share on other sites More sharing options...
TLawrence Posted December 12, 2008 Author Share Posted December 12, 2008 I don't have access to the database in question, but I can look at my own local databases...I see what you're talking about. Thanks for the tip, this definitely helps! Quote Link to comment https://forums.phpfreaks.com/topic/136713-solved-cannot-open-user-default-database-using-master-database-instead/#findComment-713994 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.