Sonarqube authentication - sonarqube

I just installed sonarqube. As part of automation i am required to change the admin password through command line. I see there is a document to reset the admin credentials by running the query. I am wondering where do i run the query.
update users set crypted_password = '88c991e39bb88b94178123a849606905ebf440f5', salt='6522f3c5007ae910ad690bb1bdbf264a34884c6d' where login = 'admin'
I am using official docker image for sonarqube. I logged into container and don't see any mysql, sql, psql installed. So i which DB exactly i need to login and run the query.

You might want to refer this for your question - Installing the Server.
Basically, <install_directory>/conf/sonar.properties has instructions for setting up the database if required.

SonarQube Docker images are using the H2 embedded database, and this one must not be used for production, you should configure SonarQube to use another database (MySQL, Postgresql, Microsoft SQL Server or Oracle).
Then you can run the query in one of those database.
You can also use Web API to change the password of a user such as https://sonarcloud.io/web_api/api/users (this will work with any database)

Related

Artifactory Derby DB Migration to Oracle

We are currently running Artifactory with the built-in Derby DB, and wanting to migrate to Oracle. So we follow the steps in https://www.jfrog.com/confluence/display/RTF/Configuring+the+Database to migrate data. In data export, I selected "Exclude Content".
We configured Artifactory with LDAP and after migration, the LDAP configs are all in place and login is working fine with LDAP. Everything seems OK but when I check the Permission and Groups, none got migrated over to Oracle. Am I missing something here? Do I need to recreate the Permissions and Groups? My understanding and assumption are that, everything will be migrated over.

What is the default sonar database?

I'm trying to reset the admin password of my SonarQube and I have already found that is executing the following query:
update users set crypted_password = '88c991e39bb88b94178123a849606905ebf440f5', salt='6522f3c5007ae910ad690bb1bdbf264a34884c6d' where login = 'admin'
But the thing is that I don't know what is the database manager where I need to execute it and how to connect to it. When I installed my SonarQube and my SonarQube Scanner I didn't specified any database manager.
The only "default" SonarQube database is the embedded H2 database, which is provided solely for initial testing. It is neither intended nor supported for production use. You will not be able to upgrade with this database. As a large red banner should be telling you at the bottom of every single page in the SonarQube interface.
But okay, to answer your question, you can use any generic client to make this update. I generally use SQuirreL SQL on the rare occasions I need to peer into the black box that is the SonarQube database.

How do I connect to oracle apex database through JDBC?

I have got a workspace in apex.oracle.com , Now , I want to connect to that database through JDBC from ubuntu-14.04 machine. please explain the steps , From where should I download the drivers and what should be the arguments in
DriverManager.getConnection();
step by step please. Thank you
You will not be able to connect to the database that's supporting the APEX instance on apex.oracle.com. If you are hosting your own instance, it's no different than connecting to any other Oracle database.A quick code snippet can be found here: http://www.java2s.com/Code/Java/Database-SQL-JDBC/TestOracleJDBCDriverInstallation.htm. You will need a password for the user/schema that you wish to connect to. If you don't have one, then talk to your DBA.
BTW, please remember that no production-type application and data should be used on the public APEX instance.
Maybe your problem is (or was) that you cannot connect via JDBC using the users you administered in your APEX workspace.
It seems to me that APEX users are not regular users for DB connections via JDBC. If my assumption is right, then you need to create database user with sufficient privileges to access the workspace tables.

Database Project and SQLCMD doing a comparison

We currently have a Database Project, which we wrote a WIX Installer for to deploy it, using VSDBCMD means we are able to do a comparison against the current database, and do an update or fresh install when required.
However we have found some issues with this:
1. We need a separate Database installer that needs to be executed on the SQL server (if you want to do it from another server, we found can only be done if it is a domain server and u use a account that has access to both systems and is a sysadmin on the sql).
2. Compact framework has to be installed for VSDBCMD to work.
We are now at a point where we would like to integrate our Database installer into our main installer, this means that most of the time we will be installing from a different system then the sql machine and would like to be able to use an SA account to install the database.
We have tried out SQLCMD, but that doesn't seem to be able to do a comparison on an already existing database.
I would like to know that if a) it is possible to use SQLCMD to do a comparison and how that would work, or b) if SQLCMD is not an option, can VSDBCMD work with an sa account, rather then a domain account?
Thanks
SQLCmd can only execute SQL commands or batches on a database server - it assumes the person writing the script knows the current state of the database and the script will be executed as if it was run in SSMS.
If you want to use the declarative development powers of Visual Studio then you need to use VSDBCMD to deploy them onto your server machine. If you use a connection string in the command line that doesn't use integrated login, you should be able to execute it from your client machine. For example:
"Data Source=$Server;User ID=$UserName;Password=$Password"
Then a SQL Server login for $UserName would suffice.

Install roles and membership to a specific database in command prompt

I would like to install membership and roles to a specific database. It seems to create a new database : aspnetdb. I tried using the GUI (Wizard) but that installed personalization. I tried adding "...Localhost/DatabaseName" but that didn't work.
See the command-line options at ASP.NET SQL Server Registration Tool (Aspnet_regsql.exe)
Specifically, -d <database>:
Specifies the name of the database to
create or modify for use with
application services. If the database
is not specified, the default database
name of "aspnetdb" is used.

Resources