Not able to install MYSQL on EC2

0

New to AWS, i have installed a EC2 instance (in Amazon Linux 2023 eng) and using EC2 Instance Connect, i have connected to the instance. Also trying to install the MySQL in the server to be able to connect to RDS. Command which i am using:

mysql -bash: mysql: command not found

sudo yum install mysql -y

Error: Failed to download metadata for repo 'amazonlinux': Cannot prepare internal mirrorlist: Curl error (28): Timeout was reached

Ignoring repositories: amazonlinux, kernel-livepatch No match for argument: mysql Error: Unable to find a match: mysql

2 Answers
0
Accepted Answer

AL2023 is bundled with MariaDB 10.5. To install

sudo dnf install mariadb105-server

Root login in mariadb 10.4.3 and higher uses unix_socket. To connect

sudo mysql -uroot -p

Press enter when prompt for password

Also, this error Failed to download metadata for repo 'amazonlinux': Cannot prepare internal mirrorlist: Curl error (28): Timeout was reached indicates network connectivity errors to yum repository. Are you able to access internet from EC2 instance? You need to fix this, i.e. able to ping and connect to the internet, e.g.

%% ping al2023-repos-us-east-1-de612dc2.s3.dualstack.us-east-1.amazonaws.com
PING s3-r-w.dualstack.us-east-1.amazonaws.com (52.217.82.176) 56(84) bytes of data.
64 bytes from s3-us-east-1-r-w.amazonaws.com (52.217.82.176): icmp_seq=1 ttl=221 time=226 ms
64 bytes from s3-us-east-1-r-w.amazonaws.com (52.217.82.176): icmp_seq=2 ttl=221 time=226 ms

Check your EC2 security group and associated route table. The article Why can't my Amazon EC2 instance connect to the internet using an internet gateway? may help.

AWS
EXPERT
Mike_L
answered 7 months ago
profile pictureAWS
EXPERT
reviewed 7 months ago
0

Thanks for the response,

But i'm still getting the response as below:

Amazon Linux 2023 repository 0.0 B/s | 0 B 06:00

Errors during downloading metadata for repository 'amazonlinux':

Curl error (28): Timeout was reached for https://xxxxxxxxxxxxx.us-east-1.amazonaws.com/core/mirrors/2023.2.20231002/x86_64/mirror.list [Connection timeout after 30000 ms] Error: Failed to download metadata for repo 'amazonlinux': Cannot prepare internal mirrorlist: Curl error (28): Timeout was reached for https://xxxxxxxxxxxxxx.us-east-1.amazonaws.com/core/mirrors/2023.2.20231002/x86_64/mirror.list [Connection timeout after 30000 ms] Amazon Linux 2023 Kernel Livepatch repository 0.0 B/s | 0 B 06:00 Errors during downloading metadata for repository 'kernel-livepatch': Curl error (28): Timeout was reached for https:/xxxxxxxxxxxxxxxxxxx.us-east-1.amazonaws.com/kernel-livepatch/mirrors/al2023/x86_64/mirror.list [Connection timeout after 30000 ms] Error: Failed to download metadata for repo 'kernel-livepatch': Cannot prepare internal mirrorlist: Curl error (28): Timeout was reached for https://xxxxxxxxxxxxx.amazonaws.com/kernel-livepatch/mirror

Ignoring repositories: amazonlinux, kernel-livepatch No match for argument: mariadb105-server Error: Unable to find a match: mariadb105-server

Venkat
answered 7 months ago
  • the message "Curl error (28): Timeout was reached" indicates internet connectivity issue. Check that your EC2 instance can reach the internet as per my updated post

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions