Error 1044 <42000>: Access denied for user ''#' localhost' to database - mysql-error-1044

I started learning PHP since last few days and this is where I'm stuck at.
When I try to type CREATE DATABASE blog; in shell, this is the error I get
'Error 1044 <42000>: Access denied for user ''#' localhost' to
database'
How do I fix this?
I found titles to this error but those answer were complicated for me to understand.

Entering mysql without a special user is not working. Or better to say: You enter the database, but the user you use then, has nearly no rights/priviliges. So in the beginning you need to login with your root account with mysql -u root -p.
Then you can create your databases and work with them.
Hint 1: Never work with the root user in a productive system, but create an user, that just has access to one database.
Hint 2: Change the password of the root user as soon as possible with UPDATE user SET Password=PASSWORD('mein_pwd') WHERE user='root'; when you're in the database.

Related

Read user on Influx 1.8.3 still can drop measurements from Grafana

I am having a problem whith permissions in influx 1.8.3.
I created a new user and grant read permisions for it.
This is the user that I configured in grafana for make queries. The point of this is avoid delete data from grafana, however, If I write "Drop measurement xxx", the measuremet is dropped...
How works permissions here?
Ther is something I am missing?
A lot of thaks!

authorized_keys getting deleted from Google Cloud VM

I am trying to set up Jenkins for software hosted in Google Cloud VM. I have a VM with user account A and user account B. Jenkins is hosted in user account A. All the other softwares are hosted in user account B. In order to authorize Jenkins to ssh into userB#VM_ADDRESS, I am placing user A's .ssh/id_rsa.pub into user B's .ssh/authorized_keys. This allows for Jenkins to ssh into userB#VM_ADDRESS to update my software whenever I push changes to Github. However, after awhile, for some reason the .ssh/authorized_keys in user account B is replaced/refreshed and my key is gone, and the ssh from Jenkins would fail with permission denied. How should I solve this? Or am I doing Jenkins wrong?
I saw this thread at https://groups.google.com/g/gce-discussion/c/iHqRb2KlMZg/m/x59xV4pYAQAJ?pli=1 that seems to be a similar problem but after reading through I still do not know what I need to do.
The SSH keys in the metadata are redeployed regularly. To solve the issue, instead of performing manually the copy/paste in the system, copy the key and (add it to the compute engine metadata](https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys)
However, I'm not sure that is the good way to follow. Why you don't log in with the account A, because it's the "reality" and perform action on software? You can put the account A and the account B in the same Linux group, or performing a chown to change the owner of the fresh files at the end.
What's the requirements behind this tricky question?
Update 1:
The fact to use the key of the account A to log into the user B, is like an impersonation. At the end, you don't know if it's the user account A or B which have performed stuff on your file.
Anyway, in linux you have 3 level of permission UGA (User, Group, All), that's why you have something like this when you perform a ls -la: rwxr-xr-- which mean U (User) can do RWX (Read Write eXecute), group can only Read and eXecute and all can only read.
Therefore, if the user account A and user account B are in the same Group, you can set common group permissions and avoid all (others) to access to the files.

schtask highest privileges without specifying user

I exported one scheduled job I created. And it should be possible to import that task to other computers using cmd/powershell.
Is there a way to tell schtask that it should use current user that is logged on and use the highest privileges to execute this job?
May help:
All computer are in the same local network and sem system group.
Console where schtask import xml is executed already has admin rights.
schtask \create \tn <myService> \xml <my xml path>
If schtask can somehow prompt for which user to use it would be ok. Even if it will ask for a password.
But I don't want to write user password into cmd as argument (i don't see that option safe for my situation)
Perfect would be to just automatically select the current user that is logged on.
Thank you ;)
I specified to run the script as "User" and it works on all computer. If someone can explain what this User means would be nice

How can I log all Rails production console access on Heroku?

I would like to incorporate company policy into the Rails console so that any customer data being accessed via the console is logged and saved.
Ideally, whenever a developer opens up the console, it should ask him/her for the reason they are doing so along with the customer context if any, and then save any commands run in that session. This log should be stored somewhere and ideally land up in the Inbox of someone who monitors these things.
My question is if such a paradigm exists already on Heroku, and addon, or through a gem, or if not, some direction on how this can be implemented?
Heroku doesn't give you any way to do that automatically.
Consoles are code being executed though. So you could log the start of a bin/console wherever you want, and ask the person for their reason as the beginning of the session.
As mentioned by spickermann in the comments, people with push access would be able to override that. But Heroku logs all deployments. So if someone tried doing that, you'd know about it too.
The archer gem can log Rails console activity to a database.

Postgres server doesn't launch

I try to set up Postgres for rails in order to be able to deploy on Heroku. I am actually resuming rails tutorials and am a bit lost (am no programmer)
In PgadminIII I try to connect to the single server available (POSTGRESQL 9.3 Localhost 5432)
It asks for a password (which I am guessing at the moment) and shows error:
server doesn't listen
My questions are:
Is the password the super user password? (the only one I own at the moment)
what is the purpose of the super user password?
How can I recover the password that activates the server?
Follow up this tutorial from command line and that way you can alter the password and create a new user with custom password.
Actually by default there will be template1 database that creates postgresql while intalling it for the first time and then you can create your database.
First you do all the steps mention in this tutorial and then from you applicatio you eed to create a database like
rake db:create:all
Postgresql Tutorial
super user password need to setup postgresql on you system, by which you can get access of super admin.
Password recovery command is also there in tutorial.
-------Updates---------
There are two possible reasons for this: either the server isn’t running at all. Simply start it.
The other non-trivial cause for this message is that the server isn’t configured to accept TCP/IP requests on the address shown.
Check your postgresql.conf file, add a line
tcpip = true
or if it is already there as "FALSE" value then just replace above line.
Hope this helps.

Resources