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 Antworten
0
Akzeptierte Antwort

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
EXPERTE
Mike_L
beantwortet vor 7 Monaten
profile pictureAWS
EXPERTE
überprüft vor 7 Monaten
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
beantwortet vor 7 Monaten
  • 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

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen