Database error that appears when updating the page - SQL server

Asked

Viewed 56 times

1

I have a system made in CODEIGNITER where several users access simultaneously, and lately I’m receiving complaints that on several pages of the portal, appears the following error:

"Unable to connect to your database using the provided settings"

Seems like a pretty generic mistake, so I don’t know what the problem is.

inserir a descrição da imagem aqui

On every page this error appears randomly, and always indicating the error in different lines and files, and it disappears right when the page is updated.

inserir a descrição da imagem aqui

I researched this error and found this: "It’s in single-user mode and the only available connection is already being used by someone or something else." but I don’t know how to fix it, and I don’t know if it has anything to do with the problem.

Database file.php

$db['MKTM'] = array(
'dsn'   => '',
'hostname' => 'localhost',
'username' => 'usuario',
'password' => 'senha',
'database' => 'banco',
'dbdriver' => 'sqlsrv',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'development'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE

);

  • Please turn this command and tell me the result SELECT DATABASEPROPERTYEX('TABELA','UserAccess'); where table is the name of your table

  • The result was: NULL

  • there is an unscheduled result, I will respond with the change test mode and tell me if it resolves.

  • uses this select here and sees the maximum number of simultaneas connectives SELECT * FROM sys.Configurations c WHERE c.name = 'user Connections'; if you have a low number, to increase just use this command here EXEC sp_configure 'user Connections', 0; RECONFIGURE (setting zero it goes to default which is the maximum)

1 answer

0

To change user settings for SQL-Server, just rotate the following command:

ALTER DATABASE DATABASE_NAME
SET MULTI_USER;
GO

If an error occurs while executing a command, accusing a user is already logged in, drop the services that use the database and run again.

Reference

Test and tell me if it worked.

  • I will test, but what it means to change to multi user my bank?

  • in case will release for multiple users access simultaneously

  • but bank users, right? I only have one

  • @Beatrizsgavioli will allow multiple connections from the same user,

  • right, I did it here but it kept giving the error. but I noticed that this error appears when two people try to access the site at the same time

  • Wheel again SELECT DATABASEPROPERTYEX('TABELA','UserAccess'); remember to change the table by its table name. and see if it will return something different.

  • is still giving NULL

  • I simulated a test here it returns null when you type the wrong table name. : z https://i.stack.Imgur.com/vF2at.png see print

  • how strange, I already wrote the name of the table of all the ways only the name, with the dbo in front, with the name of the bank in front, in brackets... all give NULL

  • I saw here and this function I need to pass the name of the bank and not the table, I will test

  • Now appeared "MULTI_USER"

  • Sky bro is Bank I’m writing sorry table

  • kkkkkk all right, but I checked here and the bank was already multi user =/

  • And the problem still persists ?

  • @Beatrizsgavioli case does not update the question with the database.php for me to see how it is configured.

  • I’ll update the question

Show 11 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.