Archive for October, 2020

Connect MySQL Workbench to an AWS Instance

  • Download and install MySQL Workbench.
  • Open MySQL Workbench.
  • Select MySQL New Connection and enter a connection name.
  • Choose the Connection Method, and select Standard TCP/IP over SSH.
  • For SSH Hostname, enter the public IP address of your EC2 instance.
  • For SSH Username, enter the default SSH user name to connect to your EC2 instance.
  • Choose SSH Key File, and select the .pem file used to connect from your file system.
  • For MySQL Hostname, enter the database endpoint name.
  • To find the endpoint name:
    Login in AWS console.
    Click Services, and search for RDS (Managed Relational Database Service).
    Click on Databases.
    Click on the DB Identifier under the cluster DB Identifier you to connect to using MySql Workbench.
    The endpoint for that database will be displayed under Connectivity & security.

  • For MySQL Server Port, enter the port number that you use to connect to your database.
  • This will be in the same location as the identifier.

  • For Username, enter the user name that you use to connect to your database.
  • For Password, enter the MySQL user password.
  • Choose Test Connection. After the test is successful, choose OK to save the connection.
  • Howto extend an XFS partition in AWS.

    Login to the EC2 Console.
    Go down to Elastic Block Store.
    Select Volumes.
    Select the volume
    Click Actions and then Modify Volume.
    Enter the new size and click Modify.

    At this point, you will need to extend your volumes and partitions.

    In this case, I was not using LVM, so it was a pretty simple process.

    Check to see which partition you want to extend:

    $ df -hT
    /dev/xvda1 xfs 8G 8.7G 8G 97% /

    Determine the block device and the partition number:

    $ lsblk
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    xvda 202:0 0 8G 0 disk
    └─xvda1 202:1 0 8G 0 part /

    Expand to partition to all the available unallocated storage on the disk:

    $ sudo growpart /dev/xvda 1

    Verify to see if the partition has been extended.

    $ lsblk
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    xvda 202:0 0 30G 0 disk
    └─xvda1 202:1 0 30G 0 part /

    Extend the filesystem on the partition:

    $ sudo xfs_growfs -d /

    Verify:

    $ df -h
    Filesystem Type Size Used Avail Use% Mounted on
    /dev/xvda1 xfs 30G 9.1G 21G 31% /

    Return top

    INFORMATION