I'm trying to create a database in PostgreSQL using Wix ToolSet, but I'm always getting the error "Error -2147467259: failed to create SQL database: pontow, error detail: unknown error." when I try to create a database or the error "Failed to connect to SQL database. (-2147467259 pontow )" when I simple try to execute a to a existing database. I made some research and it seems to be something with access denied, but can't get it working.
I've already tried:
Change 'postgresql.conf' and set 'listen_address = '*'';
Change 'pg_hba.conf' and add the line 'host all all 0.0.0.0/0 trust';
PostgreSQL v9.6 and v11.2;
Give full permissions to "Everyone" to the PosgreSQL folder and subfolders;
Use Wix 'sql:SqlDatabase' SQL Authentication and Windows Authentication;
I'm using Windows 10 x64, Wix ToolSet v3.11.
My Product.wsx file:
<Binary Id="CreateTable" SourceFile=".\CreateTable.sql"/>
<Property Id="SQLUSERNAME" Secure="yes">postgres</Property>
<Property Id="SQLPASSWORD" Secure="yes">test</Property>
<Property Id="SQLSERVER" Secure="yes">localhost</Property>
<Property Id="SQLSERVERPORT" Secure="yes">5432</Property>
<Property Id="DATABASE_NAME" Secure="yes">pontow</Property>
<util:User Id="SQLUser" Name="[SQLUSERNAME]" Password="[SQLPASSWORD]" />
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='InstallDir' Name='Test'>
<Component Id="SqlComponent" Guid="35e0e97e-cdce-428b-b553-d82fadf56b28" KeyPath="yes">
<sql:SqlDatabase Id="SqlDatabase" Database="[DATABASE_NAME]" User="SQLUser"
Server="[SQLSERVER],[SQLSERVERPORT]" CreateOnInstall="yes" DropOnUninstall="yes" ContinueOnError="no">
<sql:SqlScript Id="CreateTable" BinaryKey="CreateTable" ContinueOnError="no" ExecuteOnInstall="yes"/>
</sql:SqlDatabase>
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id='SqlFeature' Title='SqlFeature' Level='1'>
<ComponentRef Id='SqlComponent' />
</Feature>
I expect to create a PosgreSQL database using Wix Toolset or any suggestions to create a database from the Setup.exe would be appreciated.
WixSqlExtension supports SQL Server only, not PostgreSQL.
Related
I use the latest version of ActiveMQ Artemis with the MySQL database as message store. After 8h my server times out client db connections. The AbstractJDBCDriver implementation in Artemis does not recognize this and throws an exception.
What to do? I see no possibility for a DB connection pool with this implementation.
at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) [mysql-connector-java.jar:8.0.19]
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64) [mysql-connector-java.jar:8.0.19]
at com.mysql.cj.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:2056) [mysql-connector-java.jar:8.0.19]
at org.apache.activemq.artemis.jdbc.store.drivers.AbstractJDBCDriver.stop(AbstractJDBCDriver.java:108) [artemis-jdbc-store-2.10.0.redhat-00004.jar:2.10.0.redhat-00004]
Same question here.
At this point the best thing to do is to restart the broker when this happens. There currently is no DB connection pool implementation, as you note.
In the latest Artemis release (2.16.0) there is support for connection-pooling.
Basic example with MySQL:
Create a new broker instance:
$ARTEMIS_HOME/bin/artemis create hosts/host0 --name host0 --user admin --password admin --require-login
Start the database and create a dedicated instance:
CREATE DATABASE activemq CHARACTER SET utf8mb4;
CREATE USER 'activemq'#'%' IDENTIFIED WITH mysql_native_password BY 'activemq';
GRANT CREATE,SELECT,INSERT,UPDATE,DELETE,INDEX ON activemq.* TO 'activemq'#'%';
FLUSH PRIVILEGES;
Download and copy the specific JDBC driver:
curl -sL https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.22.tar.gz -o driver.tar.gz
tar xf driver.tar.gz && cp mysql-connector-java-8.0.22/mysql-connector-java-8.0.22.jar hosts/host0/lib/
Add JDBC storage with connection-pooling configuration:
<store>
<database-store>
<data-source-properties>
<!-- All configuration options: https://commons.apache.org/proper/commons-dbcp/configuration.html -->
<data-source-property key="driverClassName" value="com.mysql.cj.jdbc.Driver" />
<data-source-property key="url" value="jdbc:mysql://localhost:3306/activemq" />
<data-source-property key="username" value="activemq" />
<data-source-property key="password" value="activemq" />
<data-source-property key="poolPreparedStatements" value="true" />
<!-- Avoid MySQL default behavior of killing long lived connections after 1 hour -->
<data-source-property key="maxConnLifetimeMillis" value="1800000" />
</data-source-properties>
<bindings-table-name>BINDINGS</bindings-table-name>
<message-table-name>MESSAGES</message-table-name>
<large-message-table-name>LARGE_MESSAGES</large-message-table-name>
<page-store-table-name>PAGE_STORE</page-store-table-name>
<node-manager-store-table-name>NODE_MANAGER_STORE</node-manager-store-table-name>
</database-store>
</store>
I'm trying to generate some data for DB2 10.5 LUW using HammerDB v3.1 which is running on a Windows remote host. There is no ability to run HammerDB on the same host with DB2.
According to the HammerDB documentation I need to set up IBM Data Server Driver for ODBC and CLI.
What I did:
Downloaded and set up the driver on HammerDB host - v10.5fp10_ntx64_odbc_cli.zip as described here
Configure db2dsdriver.cfg file
<configuration>
<dsncollection>
<dsn alias="TPCC" name="<my database name>" host="<my host name>" port="50000"/>
<!-- Long aliases are supported -->
<dsn alias="longaliasname2" name="name2" host="server2.net1.com" port="55551">
<parameter name="Authentication" value="SERVER_ENCRYPT"/>
</dsn>
</dsncollection>
<databases>
<database name="<my database name>" host="<my host name>" port="50000">
<parameter name="CurrentSchema" value="OWNER1"/>
.......
Add environment variable DB2DSDRIVER_CFG_PATH
set DB2DSDRIVER_CFG_PATH=C:\ProgramData\IBM\DB2\C_IBMDB2_CLIDRIVER_clidriver\cfg
Run HammerDB GUI, try to build a schema and receive
Error in Virtual User 1: [IBM][CLI Driver][DB2/LINUXX8664] SQL0206N "GLOBAL_VAR1" is not valid in the context where it is used. SQLSTATE=42703```
This error is happening because the db2dsdriver.cfg has excess information for your DSN on a Db2-client-node.
To recover, you can either rename and recreate your db2dsdriver.cfg/db2cli.ini files, or you can can edit the db2dsdriver.cfg file and remove the following stanza where it occurs for your DSN / database (take a backup as a precaution):
<sessionglobalvariables>
<parameter name="global_var1" value="abc"/>
</sessionglobalvariables>
I usually discard the default db2dsdriver.cfg/db2cli.ini, and use a script to populate them. This is possible by using the command line tool "db2cli", which has a variety of command lines parameters to let you write the cfg file stanzas for both DSN and databases. Documentation here.
I'm having a difficult time getting localdb running under IIS in the connection strings. I am running:
Windows 10
SQL Server 2016 Express and LocalDb installed
I added the following to my applicationHost.config, which I would not like to do if possible, but it changed the original error I was getting about not connecting:
<applicationPools>
<add name="myappPool"
autoStart="true" managedRuntimeVersion="v4.0">
// Added this <processModel identityType="ApplicationPoolIdentity" loadUserProfile="true" setProfileEnvironment="true" />**
</add>
<applicationPoolDefaults managedRuntimeVersion="v4.0">
<processModel identityType="ApplicationPoolIdentity"
loadUserProfile="true" setProfileEnvironment="false" />
</applicationPoolDefaults>
</applicationPools>
The myAppPool is running under ApplicationPoolIdentity but changing this to another level of like LocalService doesn't help.
I am now getting this error:
An attempt to attach an auto-named database for file
C:\_sites\mySite\Databases\MyDb.ldf failed. A
database with the same name exists, or specified file cannot be
opened, or it is located on UNC share.
Here is my connection string:
<add name="core"
connectionString="Server=(localdb)\mssqllocaldb;Integrated Security=true; AttachDbFileName=C:\\_sites\mySite\Databases\MyDb.ldf;" />
I can verify that I can connect to (localdb)\mssqllocaldb if Management Studio. I was assuming that localdb meant I did not have to attach the db like I regularly do with sql if using the connection string above. I even added anonymous logon to the file security of the files just to see what would happen.
Any ideas?
I am developing for Websphere 8.5 (for z/OS), but i would like to use Liberty for local development on my Windows machine. I can't get the data source to work.
I created the following entry in the Server.xml to define the data source.
<library id="DB2JCC2Lib">
<fileset dir="C:\Program Files\IBM\SQLLIB\java"/><!--includes="db2jcc.jar db2jcc_license_cu.jar db2jcc_license_cisuz.jar"-->
</library>
<dataSource id="xxdb" jndiName="jdbc/xxxx" type="javax.sql.ConnectionPoolDataSource">
<jdbcDriver libraryRef="DB2JCC2Lib" id="db2-driver" javax.sql.ConnectionPoolDataSource="com.ibm.db2.jcc.DB2ConnectionPoolDataSource"/>
<properties.db2.jcc driverType="2" databaseName="xxxx" portNumber="50000" user="xxxx" password="{aes}xxxx"/>
</dataSource>
When my application initializes i get the following error message:
[jcc][4038][12241][3.61.65] T2LUW exception: SQL30081N Kommunikationsfehler. Verwendetes Kommunikationsprotokoll: "TCP/IP". Verwendete Kommunikations-API: "SOCKETS". Position, an der der Fehler erkannt wurde: "127.0.0.1". Übertragungsfunktion, die den Fehler festgestellt hat: "connect". Protokollspezifische(r) Fehlercode(s): "10061", "", "". SQLSTATE=08001
I think this message comes from the db2 Driver, unfortunately i didn't find a way yet to change it to english; but i think it's understandable for english speakers.
I have an ODBC System datasource that connects to DB2 v10 maintenance level 015 for z/OS. My local DB2 Connect Installation is v9.7.300.3885.
In my regular Websphere my working datasource has driver type 2, database Name set to the odbc-name and port number 50000. Server name is not set (empty). Classpath and implementation class is the same that i provided in the server.xml
I have tried everything i could find, any ideas?
Note: I can't make changes on the db2 server and there is no issue connecting to the database with other tools and the regular WebSphere.
Also the server name in the websphere configuration is empty, only database name is set. When i tried to set the servername in the server.xml to localhost or the db2 server i got the same result.
Any help is appreciated!
Edit: updated with correct Version Information
Edit 2: As long as it works i dont care what type (2 or 4) of the jdbc driver is used. I just want to point out again that type 2 is currently working on my machine. I tried it with type 4 and got the following message:
[jcc][t4][2043][11550][3.61.65] Exception java.net.ConnectException: Error opening socket to server xxx/xxx.30.3.34 on port 50,000 with message: Connection refused: connect. ERRORCODE=-4499, SQLSTATE=08001 DSRA0010E: SQL State = 08001, Error Code = -4,499
Sorry, previous post ate my xml. Trying again:
You will need a type 4 datasource to connect to a remote database server, i.e.,
<dataSource id="xxdb" jndiName="jdbc/xxxx" type="javax.sql.XADataSource">
<properties.db2.jcc driverType="4" serverName="the.db2.host.com" portNumber="50000" user="xxxx" password="xxxx" databaseName="LOC1" currentSQLID="SYSA"/>
<jdbcDriver libraryRef="DB2JCC2Lib">
</dataSource>
Type 2 is only for a local z/OS connection to a database resource. Your Windows, being remote from z/OS, requires you to use a type 4 connection. Type 4 requires both the serverName and portNumber to be specified. These are not applicable on a type 2 connection.
I'm trying to track down a SQL Server CE issue that means I cannot use SQL Server CE on a local hard drive of my computer. Clearly the error message is a bogus one as the filename is nowhere near 260 chars
The file resolves to a path that is too long.
The maximum length is 260 characters. [ File name = D:\db.sdf ]
Specifically the D: drive. I have a very simple EF code first app that I want to unit test using SQL Server Compact Edition. When I run the app the first time I try to access the database I get the error above. Originally I tried using a simple filename as the Data Source in the connection string:
<add name="MyContext"
connectionString="Data Source=db.sdf"
providerName="System.Data.SqlServerCe.4.0" />
but got the error.
Then I tried specifying the root drive:
<add name="MyContext"
connectionString="Data Source=D:\db.sdf"
providerName="System.Data.SqlServerCe.4.0" />
and got the same error
If I tried using either a network drive or the c drive:
<add name="MyContext"
connectionString="Data Source=C:\db.sdf"
providerName="System.Data.SqlServerCe.4.0" />
or
<add name="MyContext"
connectionString="Data Source=\\Server\path\db.sdf"
providerName="System.Data.SqlServerCe.4.0" />
The it worked fine and the db was created and the operations performed.
I tried digging around in procmon and all I could find was an Explorer.exe process reporting invalid device for the d: drive.
Any help greatly appreciated
Cheers
Dave
Sounds a bit similar to my problem
I'm using MS Sql Server Management Studio Express R2 SP1...
When I try to create a CE/sdf database on the D:drive it just blinks at me, and asks me for the db path again
I managed to create a CE db on D: via Visual Studio (the inline server manager), but SSMSE still can't access it
If I do it on the C: it works fine.
Bizarre, but I think Sql CE just hates none C drives?