Unable to login to sonar - mysql

I am trying to setup sonar in my pc.
Following the exact same steps as per official documentation.
I changed the database to mysql and port to 4950.
sonar.web.port=4950
sonar.jdbc.username=sonar
sonar.jdbc.password=root
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
Now I can access sonar at port 4950,mysql contains a table of users which has a row of admin but i am unable to login with admin credentials.
I reverted back to its embedded database but still unable to login with admin credentials. Is there any property required to set or am I missing something. Please help

The docs include advice for when admin is locked out. In short, you might need to run some SQL:
INSERT INTO user_roles(user_id, role) VALUES ((select id from users where login='mylogin'), 'admin');

Related

how to connect to azure database for mysql, from azure app service with wordpress docker image?

I have an azure app service, using the latest wordpress image from docker hub. The screenshot for the azure app service:
Then in the azure app service -> application setting, I added the following key/value pairs which will be used to connect Azure database for mysql:
WORDPRESS_DB_HOST
WORDPRESS_DB_NAME
WORDPRESS_DB_PASSSWORD
WORDPRESS_DB_USER
screenshot:
Inside my Azure database for mysql, I have enabled public access / allow public access from any azure service / also add my client ip and this ip range 0.0.0.0 - 255.255.255.255. I can access it from my client and create the database which will be used by azure app service. Screenshot like below:
in server parameters, I also turn off the require_secure_transport setting:
At last, I tried to launch the site, but it throws the error "Error establishing a database connection", screenshot below:
I'm new to wordpress / docker, and don't know how to fix this issue. I also reviewed some videos / docs, and didn't see any other configuration differences. Could you please guide me how to fix this issue? Thanks very much.
You received this error message.
Warning: mysqli_real_connect(): (HY000/1045)>: Access denied for user 'ivan'#'52.xx.xxx.xx' (using password: YES)
It means MySQL received, processed, and rejected your WordPress instance's attempt to connect. So you know the hostname is right and your cloud provider's firewall settings allow your WordPress instance to exchange network data with your MySQL instance.
What's wrong?
MySQL's user name / account name setup has a quirk. An account name can look like 'ivan'#'localhost' or 'ivan'#'%' (or even something like 'ivan'#'192.0.22.33').
The first of those only allows login from localhost (or via tunneling via ssh). The second allows login from '%', meaning any host. You need the second one for your WordPress instance to get access to MySQL.
When you're logged in to MySQL from your machine, do this.
SELECT host, user FROM mysql.user WHERE user='ivan';
You should see two rows, like these
host user
---- ---
% ivan
localhost ivan
It's possible the account with '%' as the host is missing. If so that means you need to create another MySQL account and give it access to your database. Do that like this.
CREATE USER 'ivan'#'%' IDENTIFIED BY 'your_password';
FLUSH PRIVILEGES;
Next, make sure the user account you just created -- the one your WordPress software will use to connect to MySQL -- has access to your database.
GRANT ALL PRIVILEGES ON wordpress.* TO 'ivan'#'%';
FLUSH PRIVILEGES;
If you still get the error message, it's possible the password on your 'ivan'#'%' account doesn't match what you put into your WordPress configuration. You can change it with
ALTER USER 'ivan'#'%' IDENTIFIED BY 'your_password';
FLUSH PRIVILEGES;
If it still gives the same error message, it's possible that your cloud vendor requires TLS to connect to MySQL. You may want to consult their support team about that.
(This is a common stumbling block setting up new WordPress instances.)
ok just to keep and make things clear. all IPs can connect to the DB but are you actually authorized to read/write date in the DB?
I.E. this might be a permission/privilege issue.
I suggest double checking user privileges and determine who can do what on your DB
Best Regards. :-)

Wordpress - The username is not registered on this site

I'm hosting a Wordpress instance on a VPS with MariaDB. Everything seemed to work fine until now where I will try to log into my account but it says,
The username {name} is not registered on this site. If you are unsure of your username, try your email address instead.
I've never gotten this error before so I checked the MariaDB and the user is in the wp_users table. I even changed the password to make sure the password was correct. Any help is appreciated! and thank you in advance.
You can also create a new admin user from SSH access into your VPS.
For this:
Go to your website root directory.
Run the following command:
wp user create $username $emailaddress –role=$role
Be sure to replace the ($username and $emailaddress) example values with your own custom values and ($role) the role you would like the user to be configured with. When the command completes running, a password will be returned, as in the example output below:
exampl3#example.com [~/public_html]# wp user create exampl3
admin#example.com –role=administrator Success: Created user 2enter
code here Password: srWCdc3c*(&b
Refer to the table below, to determine what each role’s capabilities are. This will help you to choose which role to set as the user in the command above.
Role Description
Super Admin Can access all administration features (including site
network administration). Administrator => Can access all
administration features (within a single site). Editor => Can publish
and manage posts (including posts by other users). Author => Can
publish and manage their own posts. Contributor => Can write and
manage their own posts (but cannot publish). Subscriber => Can only
manage their profile.
After creating your account, try to log in again.
Hope this will fix your issue.
Regards

Jawsdb on heroku, new database post migration, (Mysql2::Error: INSERT command denied to user..?)

Deployed a new version of our app on heroku and migrated over database from previous free jawsdb instance. However now every time user signs up gives
(Mysql2::Error: INSERT command denied to user <username for instance
what have i missed
migrated using a dump and re-import using mysql command line. eye balled exported data and it seems to be there (user emails etc)
all config vars look ok (DATABASE_URL is mysql2...)
i can login to the database via the url
I have not had to grant access or anything like that before, anyone come across this?
thanks
Ben
My guess is they disabled your INSERT grant because you have reached your max Storage Capacity for your plan.
To validate this is a permissions problem, log into a MySQL prompt with the user the app is running as, and enter this query:
SHOW GRANTS;
It probably list many, but no INSERT.
See this link. As explained in given link, jawsdb preliminary plan does not give you permission to add a new database. You are provided with one schema with some random name and you have to work with that only.
Check your migration
e.g. Make sure the database name matches.
For me, I got the same error as OP when trying to migrate my data. This was a fresh account with only a 50kb'ish database; nowhere close to the free-plan 5mb limit.
In my SQL export statement, my local database name is being used, however the remote MySQL (ie JawsDB) service auto-generates a db name, which will obviously not be the same. Simply used find-replace to change the database name to match remote; everything works.

Cannot connect to Google Cloud SQL using a not root account from GAE

I'm having a problem with trying to stablish a database connection with an user that's not root. I mean I have defined the following user at my database.
dev#host
I try to connect the way indicated here: https://developers.google.com/appengine/docs/java/cloud-sql/, but I get a truly strange error, I've set the application to display what error is the one that doesn't allow to connect with that user and I get this:
java.sql.SQLException:Access denied for user 'dev#host'#'localhost'.
I wonder where it can get that localhost from... I've also tried to change the name of the user to dev'#'host but it keeps on the localhost issue.
If I connect with root, not inputting any user or password it connects properly, but I need the application to be connected by users with less privileges.
Any idea what I can be doing wrong?
Thanks for your help.
Check this page…you need to set up permissions…
https://developers.google.com/cloud-sql/docs/access-control?hl=pt
Are you using a mySql client? Did you manage to add an authorized IP address?
Cheers.

Mysql authentication with Active Directory

I do not understand the following requirement i am to work on.It says--
Configuration changes are required on the MySQL database server so that the database accounts created for students should authenticate with Active Directory.
I don't understand what it means to authenticate a database with AD? I only understand the scenario in which we authenticate a website application login with AD accounts.
What needs to be done and what would I need for this?
the following posts will help you understand the issue
stackoverflow post
mysql docs