Extract adminer.sql.gz AWS

User
extract adminer.sql.gz file aws ssh
Assistant
To extract an `adminer.sql.gz` file on an AWS EC2 instance via SSH, follow these steps:

### Steps:

1. **SSH into Your EC2 Instance**
Log in to your EC2 instance using SSH:

ssh -i /path/to/your-key.pem ubuntu@ec2-your-instance-address

2. **Navigate to the File Location**
Move to the directory where the `adminer.sql.gz` file is located:

cd /path/to/adminer.sql.gz

3. **Decompress the File**
Use the `gunzip` command to extract the `.gz` file:

gunzip adminer.sql.gz

After this step, the file will be decompressed to `adminer.sql`.

4. **Verify the Extraction**
Check if the `adminer.sql` file exists:

ls -l adminer.sql

5. **Optional: Import the SQL File into MySQL**
If you need to import the SQL file into a MySQL database, use the following command:

mysql -u your_db_user -p your_database_name < adminer.sql

Replace `your_db_user`, `your_database_name`, and provide the password when prompted.

Let me know if you encounter any issues!

Leave a Comment

Your email address will not be published. Required fields are marked *