Unable to connect to the database/ru

From Dragon Age Toolset Wiki
< Unable to connect to the database
Revision as of 04:26, 3 February 2011 by Kelamor (Talk | contribs) (Translate)

Jump to: navigation, search
Unable to connect to database.png

Если при запуске тулсета появляется сообщение об этой ошибке, это означает, что проблема возникла при попытке подключения к серверу базы данных SQL Server 2005. К сожалению, это довольно распространённая ошибка, но довольно непредсказуемая. Когда набор инструментов запускается, он пытается подключиться к базе данных. Если база данных не отвечает, то тулсет просто возвращает эту ошибку, не имея средств для диагностики причин её возникновения.

Проводя аналогию с автомобилем :) можно сказать, что эта ошибка как лампа "Service(Check) Engine" у вашего автомобиля (если конечно у вас не ВАЗ-классика). Когда эта лампа начинает мигать, это означает, что что-то работает неправильно, но что именно - вы не поймёте. Это весьма общее предупреждение. Причиной этого может быть что угодно, начиная плохими свечами зажигания и заканчивая сломанными датчиками.

Вступление

Когда дело доходит до ошибки подключения, вы будете разрываться между вариантами проблем:

  • Конфликт с существующей установкой SQL Server
  • Проблемы в реестре
  • Косяк с местом установки
  • E.t.c., в смысле и т.д.

Список получится длинным, но его можно сократить. Вот руководство по устранению неполадок, призванное попытаться помочь вам диагностировать, какие конкретно проблемы вызывают ошибку подключения и как их исправить. Если всё-таки не получилось, то возможно вам поможет ручная установка, которая может оказаться более эффективной, так как вы собственноручно настраиваете сервер и можете лучше увидеть возможные в будущем проблемы.

Потенциальным помощником в разрешении данной проблемы станет также логи, в которые записываются ошибки подключения:

  • C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Log\ERRORLOG
  • C:\Program Files\Dragon Age\tools\toolssql\MSSQL.1\MSSQL\LOG\ERRORLOG

Для чтения их вам понадобится наличие администраторских прав.

Вот, для примера, содержимое такого файла:

2011-01-02 11:32:15.08 Logon       Error: 18456, Severity: 14, State: 38.
2011-01-02 11:32:15.08 Logon       Login failed for user 'EXAMPLE\Example'. Reason: Failed to open the explicitly specified database. [CLIENT: <named pipe>]

Обратите внимание, что Windows 7 автоматически блокирует файлы, найденные в C:/ (значок замка на папке). Возможно вам понадобится установить общий доступ для домашней группы (чтение/запись). Это позволит программе установки получить доступ к файлам игры для правильной установки MSSQL Server Express.


kelamor: По всей видимости речь идёт о случае, когда игра установлена на том же диске, что и операционка.


Диагностика проблемы

Имеется ли база данных (создана/восстановлена)? Нет
Установился ли SQL Server? Нет
Возможные решения:
  1. Не хватает прав: Запустите установщик с правами администратора
  2. Длинный путь: Попробуйте изменить путь установки
  3. Сжатый диск: Попробуйте изменить диск установки
Да
Да
Запущен ли сервис базы данных? Восстановите базу данных и перезапустите тулсет
Да
Нет
Верны ли настройки подключения тулсета к базе данных? Запустите сервис и перезапустите тулсет

Установился ли SQL Server?

Откройте меню "Пуск" и убедитесь, что сервер установлен (По умолчанию: Пуск -> Программы -> Microsoft SQL Server 2005). Если ничего не нашли, то возможны две основные причины:

  1. Во время установки вы сняли отметку с флажка "Install MSSQL Express 2005 SP3". В этом случае надо повторно запустить установку тулсета указав на необходимость установки SQL сервера, либо установить SQL сервер вручную.
  2. Во время установки произошла непредвиденная ошибка и сервер не установлися. Вы можете попробовать повторную установку тулсета, либо установить SQL сервер вручную.

↑ К схеме

Запущен ли сервис базы данных?

Если служба(сервис) работает, это признак того, что SQL Server установлен правильно и база данных доступна для использования тулсетом.

Вы можете проверить, работает ли сервис, открыв приложение "Службы". В зависимости от вашей операционной системы, путь может быть немного другой, но если примерно, то Пуск - Панель управления - Администрирование - Службы, либо наберите "services.msc" в окне запуска приложений.

Пролистайте список и найдите службу с именем "SQL Server (BWDATOOLSET)". Проверьте состояние службы. Если служба не запущена, то запустите её.

Если служба не запускается или не существует, значит присутствует какая-то проблема с установкой SQL Server. Возможно файлы базы данных были удалены вручную, а служба висит в списке. Путь к исполняемому поле может содержать некоторые подсказки. здесь.

  • Убедитесь в наличии SQL Server (BWDATOOLSET): Откройте SQL Server Configuration Manager (по умолчанию Пуск - Microsoft SQL Server 2005 - Configuration Tools - SQL Server Configuration Manager) и в дереве объектов на левой панели щелкните мышью на SQL Server 2005. Убедитесь, что запись для SQL Server (BWDATOOLSET), находящаяся на правой панели имеет статус Running. Если нет, то выберите его и запустите (можно с помощью кнопки на панели инструментов или опции в контекстном меню).

↑ К схеме

Имеется ли база данных (создана/восстановлена)?


kelamor: Маленькое пояснение насчёт терминов "создана/восстановлена". Программа установки тулсета после установки сервера восстанавливает базу из поставляемого вместе с ним бэкапа базы данных, отсюда и путаница(во всяком случае для меня). Я же в дальнейшем буду писать "создана".


Проверьте папку установки тулсета на предмет наличия в ней файлов базы данных. В зависимости от места установки тулсета и игры они должны быть в местах, похожих на:

  • C:\Program Files\Dragon Age\tools\toolssql\Data\ <--- версия 1.00 устанавливается в папке "Tools"
  • C:\Program Files\DAODB\ <--- путь установки для версии 1.01 (уже лучше)

Проверьте, есть ли в этих папках два файла:

  • bw_dragonage_content.ldf
  • bw_dragonage_content.mdf

Если файлы есть:, это указывает на то, что SQL Server был установлен и актуальная база тулсета была создана. Переходите к следующим шагам диагностики.

Если файлов нет:, это указывает на то, что во время установки не получилось создать базу данных. Вы можете попытаться создать её сами, используя следующие способы:

1. Скачайте и используйте SQL Management Studio для создания базы данных и восстановления её контента. Этот способ рассмотрен в статье по ручной установке базы данных. Так как SQL Server уже установлен, вам нужно пропустить первый шаг и начать с раздела "Установка SQL Server Management Studio Express". 2. Запустите операцию создания и восстановления через исполняемый bat-ник. Смотрите Бэкап и восстановление базы данных раздел "Восстановление базы данных в случае её нарушения после установки. Также там добавлен раздел "Обработка ошибок", так как bat-ник предоставляет номера ошибок.

↑ К схеме

Верны ли настройки подключения тулсета к базе данных?

Запустите программу конфигурации тулсета (en) для проверки настроек и тестирования соединения с базой данных.

Примечания:

  • Было отмечено, что для некоторых сборок тулсета возможны ошибки подключения, зависимые от ключей реестра. Возможна имеется связь с ограничением разрешений.
    1. Во-первых используя "Configure Toolset" установите правильную строку подключения.
      Если вы не используете настройки по умолчанию, то вы можете скопировать строку из "Configure Toolset", в противном случае используйте одну из следующих командных строк запрос:
      Win32: reg query "HKLM\SOFTWARE\BioWare\Dragon Age\Toolset\Environment" /v DefaultDatabaseConnection
      Win64: reg query "HKLM\SOFTWARE\Wow6432Node\BioWare\Dragon Age\Toolset\Environment" /v DefaultDatabaseConnection
    2. Теперь запустите из командной строки следующие команды(заменив строку соединения)
      reg add "HKCU\Software\BioWare\Dragon Age\Toolset\Environment" /v DefaultDatabaseConnection /t REG_SZ /d "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=bw_dragonage_content;Data Source=.\BWDATOOLSET"
Тщательно проверьте правильность ввода, так как один неправильный символ вызовет ту же ошибку подключения.

↑ К схеме]

Ручная установка

Manual database installation works almost every time. If it does not, it should at least give you clues as to why it is failing, which you do not generally get when using the toolset installer. If this "cannot connect to the database" error is frustrating you and you want to just make it work, and don't want to keep troubleshooting, this is probably your best bet:

  1. Install the toolset without any of the database options checked.
    Toolset setup screen.png
    Uncheck the following both of the database settings options as shown here. This will just install the toolset files and do nothing at all with the database itself. Of course, since SQL Server is not installed, you would still get the "Unable to to connect to the database" error at this point.
  2. Manually install SQL Server and restore the database
    It is not as hard as it may sound, and is documented here. Basically, when you do this, you are taking control of the two steps that you told the installer not to do, and doing them on your own. This is effective as this way you can babysit the installation process. Running the SQL installer this way will throw more explicit errors at you when it is having problems, making it easier to diagnose the problems and find solutions.


Why does this work?

The toolset needs a database engine to run. The installer has a copy of SQL Server 2005 embedded in it. The idea behind this is that we could hide all the SQL Server installation, setup and administration voodoo, and do it all in the background so that you wouldn't have to figure out how to do it on your own. When it works - it is great, when it doesn't - you land on this page...

When the toolset has finished doing its business (essentially unpacking some files and setting up some permissions and registry entries) it then runs the SQL Server 2005 installer in "silent" mode, where it just tries to install with its default settings. The toolset installer is "blind" to what goes on during the SQL install, it just gets a message when the SQL installer says "I'm done", regardless of what kind of "done" that is. It could be "I just failed horribly, but I'm done failing now" or it could be "Whew, everything went as planned, I'm done". Once the toolset installer gets that message, it says "SQL is done, so I can now restore the database". It then runs a command line to restore the database. Again this process does not give proper feedback either, it just spits back another "I'm done" message, at which the toolset installer comes back and tells you it is finished. Anything that goes wrong in this process will cause the dreaded error when you start the toolset. Unfortunately there is no easy way for the installer to catch these problems and alert you. Taking this process out of the installer's hands and running it manually allows you to see what is going wrong and react to it. A quick internet search for any error that you get will often help you figure out what SQL Server is choking on in your particular case.

↑ Наверх

Additional ideas

MSSQL Server cannot install to compressed or encrypted folders

SQL Server Setup cannot install files.

Product: Microsoft SQL Server 2005 -- Error 28062. SQL Server Setup cannot install files to the compressed or encrypted folder: X:\. To continue, make sure that your installation directories are not compressed or encrypted, or specify a different directory, and then run SQL Server Setup again.

Cause. SQL Server 2005 program files and data files cannot be installed on a file system that uses compression.

Solution. You need to uncompressed the drives or folders where the SQL Server 2005 program files and data files will be placed. Please follow the steps below:

  1. From your Windows Explorer, navigate to the path where the SQL Server program files and data files will be placed
  2. Make a right click on the drive or folder and select Properties
  3. If you are seeing the properties of a folder click the Advanced button
  4. Click to clear the "Compress drive to save disk space" or "Compress contents to save disk space" check box
  5. Return to setup and continue installation.

↑ Наверх

Permissions issues

  • Sometimes disabling UAC (User Account Control) and reinstalling the toolset will allow the database to install properly.
  • SQL Server needs permission to read from the directory that the you have put the installation files, if it does not have permissions, it may be unable to import resources into the database. To correct this change the administrative privileges for the directory you're installing the toolset from.
  • On Vista systems the toolset may need administrator privileges to read the database where it's installed but fail to prompt you for them. Try right-clicking the toolset's shortcut and selecting "Run as Administrator" from the dropdown menu.
  • On Windows XP systems, you may need to run the toolset as the Administrator by right-clicking on the toolset's shortcut, selecting the "Run as..." menu item, and then select "The following user" radio button where you can enter the password for the Administrator account. You can also run the toolset with a power user account, but you'll have to add a new database user to authenticate your user account with. An easy way is to run the Server Surface Area Configuration tool that should have been installed with the toolset and Microsoft SQL Server 2005 Express. Launch it with the Administrator account and then click the "Add New Administrator" link. For "user to provision", enter your Windows account name and grant them the SysAdmin role from the window below. For possibly more information, see the forum thread Anyone able to run the toolset as NOT administrator in XP?. If you were previously using the toolset under another account, then don't forget to check back in any outstanding resources so you can work on them from the current Windows account.

↑ Наверх

Other Miscellaneous Solutions

  • You can use SQL Server Express 2008 instead of 2005. It is better suited to some of the permissions issues that occur in Vista and Windows 7. Many users have installed SQL Server Express 2008 and are using it instead of 2005. You could download it and follow the instructions here substituting 2008 for 2005.
  • You can try setting up your database separately from the toolset installer. See Manual database installation for the steps needed to install MSSQL Express 2005 and configure it for use with the toolset manually. Users have been successful by setting up the toolset this way.
  • One User has reported that this sequence of events works:
  • Uninstall SQL server and the Toolset from PC.
  • Delete C:\Program Files\Microsoft SQL Server
  • In Regedit, delete the following:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MSSQLServer
HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server
  • Reboot
  • Install Toolset with the SQL.
  • If you already have MSSQLServer Express installed as part of a different program, the toolset may not get the correct configuration to use it. Run the toolset configuration program (configuretoolset.exe, in the same directory as the toolset itself) and then click "next" through the configuration wizard until you get to the "Content Database" field. It should read: "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=bw_dragonage_content;Data Source=.\BWDATOOLSET"
  • Some users report that the installer fails to create the SQL database (e.g. your Dragon Age\toolssql\data folder is empty). You can enter the following command to try restoring the database manually (Change the paths to bw_dragonage_content.bak and your Dragon Age folder as appropriate): "C:\Program Files\Microsoft SQL Server\90\Tools\Binn\"sqlcmd -S .\BWDATOOLSET -E -Q "RESTORE DATABASE bw_dragonage_content FROM DISK = 'C:\Program Files\Dragon Age\tools\dbbak\bw_dragonage_content.bak' WITH MOVE 'bw_dragonage_content' TO 'C:\Program Files\Dragon Age\tools\toolssql\Data\bw_dragonage_content.mdf', MOVE 'bw_dragonage_content_Log' TO 'C:\Program Files\Dragon Age\tools\toolssql\Data\bw_dragonage_content.ldf'"

You need to allow Users to Modify the DATA folder, before you can execute this command.

  • Some users have been successful simply installing from a more direct path (eg place the installer in C:\DAInstall and then run the exe file from that location rather than from My Documents or a similar long path).

↑ Наверх

kelamor / Страница / Почта / Как переводить DA Builder Wiki

Язык: English  • русский