Our webapplication hosted on the ec2 instance is developed in CodeIgniter - database

However there has been inconsistencies in the ci_session table in the installed MySQL server. Some ip addresses are being inserted repeatedly. However when we login from our system, those ipaddresses are not logged/inserted into the ci_session table. Does this mean that only certain ipaddresses are inserted in the ci_session table?
Can you able to provide guidance on this?
PHP version :7.2.15
MySQL version: 5.0.12
Codeigniter version : 3.1.3
Using session library : default system session library
Server : aws

Related

Intellij embedded H2 database tables do not appear

I'm creating a Spring Boot application and I'm using Intellij's embedded h2 database.
I have added the following lines in my application.properties file:
spring.datasource.url=jdbc:h2:~/testdb;MV_STORE=false;AUTO_SERVER=TRUE
This is my data source configuration
Although the connection is successful and I can query the database using Intellij's query console, the tables do not appear in the Database tab.
Succeeded
DBMS: H2 (ver. 2.1.210 (2022-01-17))
Case sensitivity: plain=upper, delimited=exact
Driver: H2 JDBC Driver (ver. 2.1.210 (2022-01-17), JDBC4.2)
Ping: 16 ms
When I refresh the connection or go to the schemas tab of the data source configuration, I get the following error:
[42S02][42102] org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "INFORMATION_SCHEMA_CATALOG_NAME" not found; SQL statement: select CATALOG_NAME from INFORMATION_SCHEMA.INFORMATION_SCHEMA_CATALOG_NAME [42102-210].
By going to the advanced tab of the data source and clicking on expert options, we are presented with a checkbox labeled "Introspect using JDBC metadata"
By checking that box, the tables successfully appear in the Database tab
Regarding why this works, this is taken from the official documentation:
https://www.jetbrains.com/help/datagrip/data-sources-and-drivers-dialog.html
Introspect using JDBC metadata
Switch to the JDBC-based introspector. Available for all the databases.
To retrieve information about database objects (DB metadata), DataGrip uses the following introspectors:
A native introspector (might be unavailable for certain DBMS). The native introspector uses DBMS-specific tables and views as a source of metadata. It can retrieve DBMS-specific details and produce a more precise picture of database objects.
A JDBC-based introspector (available for all the DBMS). The JDBC-based introspector uses the metadata provided by the JDBC driver. It can retrieve only standard information about database objects and their properties.
Consider using the JDBC-based intorspector when the native introspector fails or is not available.
The native introspector can fail, when your database server version is older than the minimum version supported by DataGrip.
You can try to switch to the JDBC-based introspector to fix problems with retrieving the database structure information from your database. For example, when the schemas that exist in your database or database objects below the schema level are not shown in the Database tool window.

Uploading Databases

How does one go about uploading a database like Apache Cassandra after creating one? Furthermore, is there a way to upload/share only its skeleton structure, without the data gathered in it? I'm on MacOS and would like to use Python to do all of this. Thank you!
Based on your second comment, I guessed it to mean you want the database to be remotely accessible to clients/apps not installed locally.
Clients/apps connect to Cassandra on the IP address set for rpc_address and the CQL port set for native_transport_port (default is 9042) set in cassandra.yaml.
You mentioned that your Cassandra instance is running on your laptop so only clients/apps running on your local network can access it if you configure rpc_address to an IP address accessible on the network (default is localhost).
If you're just trying out Cassandra and want to collaborate with other developer friends, try Astra and launch Cassandra instance on the free-tier (no credit card required). With it you can share the database credentials with your friends and they can connect to it over the internet.
You can connect to Astra from your Python app using the Python driver. Otherwise, Astra includes Stargate.io pre-configured and ready to use. Stargate is a data access gateway that lets you connect to Cassandra from your app using REST API, GraphQL API or JSON/Doc API without having to learn CQL. For more info, see Connecting to your Astra database. Cheers!

java.sql.SQLException: [tibcosoftwareinc][Oracle JDBC Driver][Oracle]ORA-28040: No matching authentication protocol

I get above error while trying to connect oracle 12c. I try using ojdbc6 and ojdbc7 jar files. I found below comment
------------------->
Bug 14575666
In 12.1, the default value for the SQLNET.ALLOWED_LOGON_VERSION parameter has been updated to 11. This means that database clients using pre-11g JDBC thin drivers cannot authenticate to 12.1 database servers unless theSQLNET.ALLOWED_LOGON_VERSION parameter is set to the old default of 8.
This will cause a 10.2.0.5 Oracle RAC database creation using DBCA to fail with the ORA-28040: No matching authentication protocol error in 12.1 Oracle ASM and Oracle Grid Infrastructure environments.
Workaround: Set SQLNET.ALLOWED_LOGON_VERSION=8 in the oracle/network/admin/sqlnet.ora file.
<-------------------
I have one dought to implement above workaround as we have shared database.
If I set SQLNET.ALLOWED_LOGON_VERSION=8 in the oracle/network/admin/sqlnet.ora file will it affect other users ?
Will it affect shared applications and its functionality ?
Setting SQLNET.ALLOWED_LOGON_VERSION=8 in sqlnet.ora affects all connections to the server. You're allowing user authentication with older versions of the password verifier and it affects all users. You can't allow it for just one user. But this isn't going to break other applications that can already connect successfully. It will allow older applications (that use old drivers) to connect too. The best solution is to upgrade all clients if possible but this setting is the workaround and it was made available for this exact purpose.

How can I resolve error when trying to launch instance on Amazon RDS?

I'm using the AWS Toolkit in Visual Studio 2013 to attempt to launch a new instance on Amazon RDS. I get through the wizard for creating the new instance and after clicking finish, there is a delay, and then a message appears saying:
Error launching DB instance: DB Security Groups can only be associated with VPC DB Instances using API version 2012-01-15 through 2012-09-17.
Launching different types of instances (SQL Server SE vs MySQL) doesn't seem to help, nor does selecting different versions of the platforms (SQL Server 2008 vs 2012). The only thing that gets it to go through is unchecking the box for "default" in the DB Security Groups area. However, I feel like something is going on here that shouldn't be happening.
Can anyone explain why this is happening and how I can resolve it other than by not setting a default security group? Thank you.
If you created your AWS account recently, you will be using a VPC by default.
It sounds like the API the plugin is trying to use hasn't been updated. The latest version is 1.5.6, and looking at the history it seems like some of these features were added in 1.5.0.
I finally solved it! Since I couldn't use the API that the VS 2013 plugin uses, I had to manually add my IP to the Security Group created for my Elastic Beanstalk.
Go to the console, ec2's security groups configuration
Find the one which description matches your Beanstalk (e.g.: Security Group created for Beanstalk Environment to give access to RDS instances)
Hit Inbound, Edit and add a new rule for All Traffic (I guess HTTP should be enough, but just in case).
In Source, select My IP and Save.

how to display the database name and change the database properties in java (spring framework)

I have a requirement to display the database name on the screen that is connected by the web application (which is configured through the datasource on weblogic server with spring data xml having all the configurations) and also is there any way to switch from current database to different datasource (database server) while working/running on the web application (with user screen).
Thanks.
As far as I know, there is no straight-forward way to know this info. One way I can think of doing this is to parse the spring config XML file using an XML parser for the desired element - even that too will only give you the JNDI name of the datasource your app would be using. I hope you have a mechanism to determine which JDBC JNDI name maps to which database. If you don't have that information, you would have to use JMX (MBeans) to connect to the Weblogic environment to get that info.

Resources