#1045 - Access denied - mysql-error-1064

MySQL said:
1045 - Access denied for user 'root'#'localhost' (using password: YES)
mysqli_real_connect(): (28000/1045): Access denied for user 'root'#'localhost' (using password: YES)
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL

Related

Access deined while configuring mysql ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: NO)

I am following this post on How to Install MySQL on Ubuntu 20.04 LTS?
Updated package index sudo apt update
Installed MySQL server sudo apt install mysql-server
Configuring MySQL sudo mysql_secure_installation, entered password
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Connect to MySQL server
When I use this sudo mysql, I get the following error shown below
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: NO)
When I use this sudo mysql -u root, I get the following error shown below
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: NO)
When I use this mysql, I get the following error shown below
ERROR 1045 (28000): Access denied for user 'username'#'localhost' (using password: NO)
When I use this sudo mysql -u root -p, I get the following error shown below
Enter password:
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
I tried resetting the password following official Mysql B.3.3.2 How to Reset the Root Password and How to Change MySQL Root Password in Ubuntu 20.04
Stopped server sudo systemctl stop mysql.service
Checked the status sudo systemctl status mysql.service
Skipped the grant tables & networking sudo systemctl set-environment MYSQLD_OPTS="--skip-networking --skip-grant-tables"
Started server sudo systemctl start mysql.service
Checked the status sudo systemctl status mysql.service
Sign in to MySQL shell sudo mysql -u root, I get the same error
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: NO)
What is the mistake? How do I correct it?
When you are here: mysql_secure_installation try to insert the password:"rootroot"
In mac is assigned by default.

Laravel forge server disconnected

We received the following error when connecting to the server:
WHEN CONNECTING AS "root" USER:
with Digitalocean droplet
Error Output
Server Disconnected
We had trouble connecting to your server. Typically, this means there is a problem with the SSH keys on the server. Or, your server may be prompting for a password when Forge attempts to SSH in as the root user.
Recently reset the root password? If you have recently reset your root password via the DigitalOcean control card, this will break Forge's access to your server. You must SSH into your server and set a new password for the root user.
We received the following error when connecting to the server:
WHEN CONNECTING AS "root" USER:
Please make sure that the following SSH key is placed in both the /home/forge/.ssh/authorized_keys file and the /root/.ssh/authorized_keys file on your server.

i am facing a problem while migrating database .. using xampp

I don't understand how to fix this problem. what should i do witthon connection.php and connector.php file
In Connection.php line 664:
SQLSTATE[HY000] [1045] Access denied for user 'root'#'localhost'
(using password: YES ) (SQL: select * from information_schema.tables
where table_schema = STDHUB and table _name = migrations)
In Connector.php line 67:
SQLSTATE[HY000] [1045] Access denied for user 'root'#'localhost'
(using password: YES )
It indicates that you're using wrong credentials to connect to MySQL.
Check your MySQL credentials, for example:
username: root
password: secret
Then you should change the value in your .env in your Laravel project folder. If .env does not exist, copy a new one from your .env.example.
DB_USERNAME=root
DB_PASSWORD=secret
Please check DB_User , DB_PWD in your .env file

createuser: could not connect to database postgres:

I am trying to create a user in PostgreSQL in Mac with the following command
createuser -P project_user
It then prompts
Enter password for new role:
Enter it again:
Password:
I enter thrice the new password for project_user but authentication fails with the below error.
createuser: could not connect to database postgres: FATAL: password authentication failed for user <my_mac_user_name>.
I was able to enter psql terminal with following command and password as 'postgres'
sudo -u postgres psql
\du displays the user project_user.
But same error appears when trying to create database with below command
createdb -O project_user DB_NAME

ERROR 1045 (28000): Access denied for user 'users'#'host'

Mysql is making me crazy....
I know that this question has been asked 1000 times but nothing works for me... I can't connect to mysql ! This arrived after I update ubuntu 13.1
$> mysql
ERROR 1045 (28000): Access denied for user 'jeremy'#'localhost' (using password: NO)
$> mysql -u root -p****
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
$> cd my_work ; rails c
Access denied for user 'working'#'localhost' (using password: YES) (Mysql2::Error)
I have tried a thousand of command lines, the only thing that not show me a permission denied is to run mysqld with the --skip-grant-tables option but once started, It is like I have no users in my db, even root user ! More, I could not create or update users because of the --skip-grant-tables
$> sudo su
$> service mysql stop
$> mysqld --skip-grant-tables --skip-networking &
$> UPDATE user SET password=PASSWORD('********') WHERE user="root";
Query OK, 0 rows affected (0.00 sec)
Rows matched: 0 Changed: 0 Warnings: 0
$> SELECT host, user, password FROM user;
localhost | debian-sys-maint | *5480DE723DE487F407399B5208AA09588E67850E
Are all my users deleted ? Is my root user deleted ? How to fix that ?!
for #user2503775, my database.yml :
development:
encoding: utf8
adapter: mysql2
reconnect: true
database: working
username: working
password: working
socket: /var/run/mysqld/mysqld.sock

Resources