when I run "sudo mysqladmin -u root password $DBRootPasswordroot'#'localhost' (using password: NO)' - amazon-ec2

I populated my credentials for my Database from parameters store into my instances but I keep getting access denied. I have tried all I can but nothing. I even started the lab from scratch but it's didn't work.
8 wasn't expecting an access denied after running " sudo mysqladmin -u root password $DBRootPassword"in

Related

How can I `ssh root#localhost` and `su root` without password on macOS?

Before asking this question, I have searched other solutions and done the following things:
ssh-keygen -t rsa and cat ~/.ssh/id_rsaK.pub >> ~/.ssh/authorized_keys
Enable root account on Mac, and set password to empty
su root, it prints out "Sorry", so I passwd root to a non-empty password
Now su root works, but still need password. I don't want this, I want to log in without type any password(Yes, it is not neat, I will check how to improve this later)
ssh root#localhost fails with the following
ssh root#localhost
Password:
Password:
Password:
root#localhost's password:
Permission denied, please try again.
root#localhost's password:
Received disconnect from ::1 port 22:2: Too many authentication failures
Disconnected from ::1 port 22
You need to put your public key into root's authorised keys. Then you should be able to ssh root#localhost without a password.
For example (make sure root has a password first):
ssh-copy-id root#localhost
# <enter root's password>
ssh root#localhost
# should log in without password
# (unless your private key is password protected, in which case, it will
# still ask for that one)
Keep in mind, some setups of SSH server forbid logging in as root. Check the /etc/ssh/sshd_config file and make sure PermitRootLogin is set to yes. If it's not listed anywhere in the file, just add PermitRootLogin yes on a line by itself (typically, anywhere in this file will do).

What is the password for root#localhost's password?

I'm configuring the hadoop 2.7.3 on windows ubuntu subsystem. I used root as the root account password, but when I try to run /bin/start-yarn.sh, I was required to input the password for root#localhost
lizhi#localhost's password:
I have tried root for this, but never worked.
I have also tried
ssh-genkey
cat /home/user/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
But it still required a password when calling ./start-yarn.sh, what is the password for this, why is it different with root account password?
I've tried to change password to root using passwd, and I still get denied:
C:\Users\lizhi>bash
lizhi#LAPTOP-SURFACEP:/mnt/c/Users/lizhi$ sudo su
[sudo] password for lizhi:
root#LAPTOP-SURFACEP:/mnt/c/Users/lizhi# passwd
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
root#LAPTOP-SURFACEP:/mnt/c/Users/lizhi# ssh localhost
root#localhost's password:
Permission denied, please try again.
root#localhost's password:
Permission denied, please try again.
root#localhost's password:
Received disconnect from 127.0.0.1: 14:
root#LAPTOP-SURFACEP:/mnt/c/Users/lizhi#
Welcome for any advise.
It is blank (as in "") unless you set it:
ssh root#localhost uses the same password for root. It looks like you have not set root password.
To do that log in as root using sudo -s then use passwd command to set root password.
After that you must be able to ssh as root
https://askubuntu.com/questions/9017/how-to-know-my-root-password

Access Denied for User ODBC # localhost

i have installed Mysql on Windows7, i used mysql with mysql command line client & i also use Mysqldump in windows cmd, & it was working without any problem. But today, i tried to export database using mysqldump with this command in cmd
mysqldump –u root -p mypassword db_name > f:\mydb.sql
i tried many other commands and i always see error
Access Denied for User 'ODBC'#'localhost' (using password: yes) when trying to connect
as you can see, in mysqldump command i am using root as user then why i get user ODBC error ? one more thing, using mysql command line client i am still using mysql normally without any problem using root as user. i also tried to login in cmd with this command
mysql –u root -p mypassword
but still same error. and my password is 100% correct. kindly tell me how to solve this problem. Thanks
Have you tried storing pass in the cfg file? http://dev.mysql.com/doc/refman/5.7/en/password-security-user.html
try from command line:
mysql -u root -p
and then, when you are being asked for password, just type it.
Try the same with mysqldump command without typing your password after -p.

cannot connect to template1: FATAL: role "_postgres" does not exist

Working on OS X 10.10, installed postgreSQL and PostGIS from
here, psql vers 9.3.5. I am having a hard time getting postgreSQL running.
I try to follow the OSM tutorial on psql and PostGis. But that seems rather hard... I am stuck here.
They suggest to create the user like:
sudo -u postgres createuser christoph
That did not work for me. I created the user like this:
$ sudo -u _postgres createuser -U postgres christoph
That worked without any problems. Then I tried this:
$ sudo -u _postgres createdb --encoding=UTF8 --owner=christoph gis
> cannot connect to template1: FATAL: role "_postgres" does not exist
How can _postgres not exist if I just created a role with it?!
I also do not understand why
$ createdb mydb
> -bash: createdb: command not found
does not work although
I added the path like:
$ export PSQL_DIR=/usr/local/pgsql/bin/
$ export PATH="$PSQL_DIR:$PATH"
before.
Executing the command like:
$ /usr/local/pgsql/bin/createdb mydb
> createdb: cannot create database: ERROR: permission denied to create database
I am looged in with the user who installed psql...
Is that connected?!
It is very easy to confuse system users (stored in /etc/passwd) with Postgres roles (stored inside the database cluster).
In your first command, you mention both types of user:
sudo -u _postgres means "use the system user _postgres to execute the following command"
the -U postgres in the command means "connect to the Postgres cluster with the role postgres"
However, in the next command:
sudo -u _postgres createdb --encoding=UTF8 --owner=christoph gis
You specify the same sudo -u _postgres, but are missing the -U argument to the actual Postgres command (you say you want christoph to own the new DB, but you don't say "I am christoph").
The Postgres command-line tools have a default behaviour of guessing that the Postgres role name is the same as the system user name. Since the system user is named _postgres (with leading underscore) and the Postgres role is named postgres (no leading underscore), this assumption fails, and you can't connect.

Postgresql: cannot access psql after changing user password

After a few weeks of not using my postgres db, I need to use it again. To my knowledge I haven't changed anything in the configuration since then, but I cannot login as my normal superuser.
psql -d %dbname% -U %username%
I get: psql: FATAL: password authentication failed for user "%username%"
Here's what I've done so far:
Sudo into the db: sudo -u %OS_username% psql
Test create a user to verify commands work: CREATE USER test WITH PASSWORD 'test'; (it worked)
Change my password: ALTER USER %username% PASSWORD 'test'
Reboot the server: pg_ctl restart -D ~/Library/Application\ Support/Postgres/var-9.3
Then I try psql -d %dbname% -U %username% again, but it fails with the same message.
Below are the active connection configurations from my pg_hba.conf:
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
local all %username% trust
I have only added the last line today, and made no other changes. PG Commander/PGAdmin refused to login as normal (as they always have done). Why and where could the credentials have been changed?
Edit: I should also note that I cannot login with the test user I created.

Resources