Running MySql server 8.0.31 on an Amazon EC2 instance (52.99.189.74) in Ubuntu 22.04. When I log in to the mysql prompt with
sudo
, this is how the user and host columns of the mysql.user
table look like.
+------------------+-----------+
| User | Host |
+------------------+-----------+
| della | % |
| debian-sys-maint | localhost |
| mysql.infoschema | localhost |
| mysql.session | localhost |
| mysql.sys | localhost |
| root | localhost |
+------------------+-----------+
6 rows in set (0.00 sec)
My Ubuntu user name, i.e. $USER is della
. However, when I try this as a non-root user, I get the following output.
$ mysql -p
Enter password:
ERROR 1045 (28000): Access denied for user 'della'@'localhost' (using password: YES)
Should not the first row of the mysql.user
table be resolved to represent my correct user credential, as my understanding was the %
sign is a wildcard to represent *any* hostname and ip address?
In the same way, if I am using a laptop (also running Ubuntu, and my username being della), and I want to login to the same mysql server remotely, can I use this, to resolve to the same user?
$ mysql --user "della" --host 52.99.189.74 --port 3306 -p
But this is also giving the exact same error. Things I have tried,
- Allow inbound traffic to port 3306 in the EC2 security group with the following protocols from any ip address. This is how the rules look like.
IPv4 MYSQL/Aurora TCP 3306 0.0.0.0/0
- Edited /etc/mysql/mysql.conf.d/mysqld.cnf to have the following parameters.
bind-address = 0.0.0.0
mysqlx-bind-address = 127.0.0.1
Anything else I need to do to get to the mysql prompt from the ec2 localhost (as a non-root user) and also remotely from my laptop?
Asked by Della
(73 rep)
Nov 22, 2022, 08:53 AM
Last activity: Nov 23, 2022, 01:17 AM
Last activity: Nov 23, 2022, 01:17 AM