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

Venkat
已提問 7 個月前檢視次數 1026 次
2 個答案
0
已接受的答案

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
專家
Mike_L
已回答 7 個月前
profile pictureAWS
專家
已審閱 7 個月前
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
已回答 7 個月前
  • 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

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南