Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Foca 4.3.7.1 - Needs SQL Database although SQL Express 2022 is installed #131

Open
kastahl opened this issue Jan 19, 2023 · 4 comments
Open

Comments

@kastahl
Copy link

kastahl commented Jan 19, 2023

I installed SQL Express 2022 successfully and run FOCA for installation.
Unfortunately, I received the message that FOCA needs a SQL database.
Trying to setup a databse connection failed.

I tried as Server name following combinations:

  • ".\SQLEXPRESS"
  • "SQLEXPRESS"
  • "localhost\SQLEXPRESS"
  • "localhost"
  • "systemname\SQLEXPRESS"

Attached also a screenshot from the FOCA error message, which refers to a connection timeout. Note that this message appears in less then a second. And a screenshot from the SQLSERVER version.

foca-error

sqlexpress-version

I already found and check this issue #95 but no luck with the solution.

@danielcshn
Copy link

@kastahl
Copy link
Author

kastahl commented Jun 26, 2023

Hi,
thx, but it still does not work.
Please see attached image.

1-

@Emergumeno
Copy link

you should try to connect through the sql authentication option, using the name of the local host or your own ip with port. after, try the sa password. It worked for me in my mac

@roizpi
Copy link

roizpi commented Oct 1, 2024

Hi, thx, but it still does not work. Please see attached image.

Here’s the solution:

I encountered the same issue, even after installing the minimum required version (SQL Server 2014). A few years ago, the installation was straightforward, but now it requires a workaround. I was able to resolve it by creating a user, following the guide in the FOCA wiki.

The steps are simple:

  1. Press Alt + R on your Windows machine to open regedit. Then, navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQLServer, and change the LoginMode value to 2.

  2. Ensure the database service is running by executing sqlcmd -S .\SQLEXPRESS in the Windows cmd console.

  3. In the SQL Server CLI (subshell), enter the following commands:

    CREATE DATABASE Foca;
    USE Foca
    GO
    CREATE LOGIN #USERNAME# WITH PASSWORD='#PASSWORD'
    GO
    CREATE USER #USERNAME# FOR LOGIN #USERNAME#
    GO
    EXEC sp_addrolemember 'db_ddladmin', '#USERNAME#'
    GO
    EXEC sp_addrolemember 'db_datareader', '#USERNAME#'
    GO 
    EXEC sp_addrolemember 'db_datawriter', '#USERNAME#'
    GO
    
  4. Remember to replace YourUsername and YourPassword with the credentials you prefer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants