{"id":242179,"date":"2024-04-04T15:27:00","date_gmt":"2024-04-04T22:27:00","guid":{"rendered":"https:\/\/virtual-dba.com\/?p=242179"},"modified":"2024-04-05T18:26:25","modified_gmt":"2024-04-06T01:26:25","slug":"running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script","status":"publish","type":"post","link":"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/","title":{"rendered":"Running MySQL Commands in AWS Cloudshell: 1st Step to Creating a Bash Script"},"content":{"rendered":"\n<p>Amazon RDS (Relational Database Service) for MySQL is a fully managed database service designed to simplify the deployment, management, and scaling of MySQL databases in the cloud. The service is an attractive option because of its high availability and durability through automated backups, automated software patching, and the option to create read replicas for improved performance and scalability. Not to mention you do not need to be a DBA to perform these tasks. Managing a database is even easier with Amazon Web Services (AWS) like CloudWatch and Cloudshell.<\/p>\n\n\n\n<p>AWS Cloudwatch is a comprehensive monitoring and observability service that enables users to collect and track metrics, logs, and events from various AWS resources and applications. It is easy to navigate and use. However, there is no way to compile the information into one report, like a health check or status report. XTIVIA created a bash script to collect metrics and parameters of the operating system and MySQL instance. Using a bash script enables XTIVIA DBAs to have more control over what information is gathered on an AWS RDS Instance and puts all the information into one output, as opposed to clicking through the Cloudwatch dashboard and manually entering the information elsewhere (because who wants to do that). Also, by connecting to the MySQL instance, you can get information not available in the AWS Cloudwatch, like schema sizes and table fragmentation.<\/p>\n\n\n\n<p>AWS Cloudshell makes running bash scripts possible. With CloudShell, users can execute commands, run scripts, and utilize various tools and utilities to manage their AWS infrastructure and services, all without needing to install any software on their local machines. Connecting to MySQL from the AWS Cloudshell CLI is essential to running a bash script. This blog will go over the steps to connect to a MySQL instance using AWS Cloudshell and include a few examples of useful queries.<\/p>\n\n\n\n<p>The first step is to get the IP address of the AWS Cloudshell Interface. Curl, NodeJS, and Python are already installed on Cloudshell. The syntax below uses curl.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><mark style=\"background-color:rgba(0, 0, 0, 0);color:#fc9b9b\" class=\"has-inline-color\">&#91;cloudshell-user@ip-10-2-67-20 ~]$<\/mark> curl -s checkip.dyndns.org | sed -e 's\/.*Current IP Address: \/\/' -e 's\/&lt;.*$\/\/'<\/code><\/pre>\n\n\n\n<p>Once you have the IP address, you must add it to the security group. From the AWS Cloudshell CLI, you add the IP address using the syntax below. Placeholders for the RDS instance&#8217;s security group ID and IP address are highlighted.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><mark style=\"background-color:rgba(0, 0, 0, 0);color:#fc9b9b\" class=\"has-inline-color\">&#91;cloudshell-user@ip-10-2-67-20 ~]$<\/mark> aws ec2 authorize-security-group-ingress --group-id <mark style=\"background-color:#ffff00\" class=\"has-inline-color\">SecurityGroupID<\/mark> --protocol tcp --port 3306 --cidr <mark style=\"background-color:#ffff00\" class=\"has-inline-color\">IPAddress<\/mark>\/32<\/code><\/pre>\n\n\n\n<p>The security group can be found on the RDS Management Console (highlighted below).<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"190\" src=\"https:\/\/virtual-dba.com\/wp-content\/uploads\/running-mysql-commands-in-aws-cloudshell-security-group-1024x190.png\" alt=\"Running MySQL Commands in AWS Cloudshell: 1st Step to Creating a Bash Script Security Group\" class=\"wp-image-242184\" srcset=\"https:\/\/virtual-dba.com\/wp-content\/uploads\/running-mysql-commands-in-aws-cloudshell-security-group-1024x190.png 1024w, https:\/\/virtual-dba.com\/wp-content\/uploads\/running-mysql-commands-in-aws-cloudshell-security-group-980x182.png 980w, https:\/\/virtual-dba.com\/wp-content\/uploads\/running-mysql-commands-in-aws-cloudshell-security-group-480x89.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p>Confirmation will look something like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"657\" height=\"413\" src=\"https:\/\/virtual-dba.com\/wp-content\/uploads\/running-mysql-commands-in-aws-cloudshell-security-group-confirmation.png\" alt=\"Running MySQL Commands in AWS Cloudshell: 1st Step to Creating a Bash Script Security Group Confirmation\" class=\"wp-image-242183\" srcset=\"https:\/\/virtual-dba.com\/wp-content\/uploads\/running-mysql-commands-in-aws-cloudshell-security-group-confirmation.png 657w, https:\/\/virtual-dba.com\/wp-content\/uploads\/running-mysql-commands-in-aws-cloudshell-security-group-confirmation-480x302.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 657px, 100vw\" \/><\/figure>\n\n\n\n<p>Once the IP address is added to the security group, you can log into MySQL using the command below. Replace the highlighted portions with the appropriate credentials. The host is the RDS endpoint. This example assumes the port is 3306 (default).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><mark style=\"background-color:rgba(0, 0, 0, 0);color:#fc9b9b\" class=\"has-inline-color\">&#91;cloudshell-user@ip-10-2-67-20 ~]$<\/mark> mysql --host=<mark style=\"background-color:#ffff00\" class=\"has-inline-color\">RDS_endpoint<\/mark> --port=3306 --user=<mark style=\"background-color:#ffff00\" class=\"has-inline-color\">master_username<\/mark> --password=<mark style=\"background-color:#ffff00\" class=\"has-inline-color\">master_password<\/mark><\/code><\/pre>\n\n\n\n<p>If all goes well, you will be logged into MySQL. If your instance uses SSL certificates, you must add the\u2014ssl-ca option to the command. More information on logging into a MySQL instance using SSL certificates can be found <a href=\"https:\/\/docs.aws.amazon.com\/AmazonRDS\/latest\/UserGuide\/UsingWithRDS.IAMDBAuth.Connecting.AWSCLI.html\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a><\/p>\n\n\n\n<p>Now this is not exactly running a bash script. We just logged into the MySQL instance. When creating the script, I recommend using variables for the hostname, port, username, and password, which I have included in the MySQL examples. If you need a refresher, the basics of writing a bash script can be reviewed in a previous blog, <a href=\"https:\/\/virtual-dba.com\/blog\/the-elements-of-a-bash-script\/\">The Elements of a Bash Script<\/a>.\u00a0<\/p>\n\n\n\n<p>The examples can be executed from the command line or within a bash script. The -t option will return the result set in table format. The -e option allows the subsequent MySQL query to be executed from the command line.<\/p>\n\n\n\n<p>Use the syntax below to obtain values for all status variables, including information like the number of temporary tables written to disk and the number of connections aborted.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql --host=<mark style=\"background-color:rgba(0, 0, 0, 0);color:#ade5fc\" class=\"has-inline-color\">$mysqlHost<\/mark> --port=<mark style=\"background-color:rgba(0, 0, 0, 0);color:#ade5fc\" class=\"has-inline-color\">$mysqlPort<\/mark> --user=<mark style=\"background-color:rgba(0, 0, 0, 0);color:#ade5fc\" class=\"has-inline-color\">$mysqlUser<\/mark> --password=<mark style=\"background-color:rgba(0, 0, 0, 0);color:#ade5fc\" class=\"has-inline-color\">$mysqlPW<\/mark> -t -e <mark style=\"background-color:rgba(0, 0, 0, 0);color:#a2fca2\" class=\"has-inline-color\">\"SHOW GLOBAL STATUS;\"<\/mark><\/code><\/pre>\n\n\n\n<p>The syntax below can be used to get the number of user-defined schemas in a database. The count function can be removed to get all the names of the user-defined schemas in a database.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql --host=<mark style=\"background-color:rgba(0, 0, 0, 0);color:#ade5fc\" class=\"has-inline-color\">$mysqlHost<\/mark> --port=<mark style=\"background-color:rgba(0, 0, 0, 0);color:#ade5fc\" class=\"has-inline-color\">$mysqlPort<\/mark> --user=<mark style=\"background-color:rgba(0, 0, 0, 0);color:#ade5fc\" class=\"has-inline-color\">$mysqlUser<\/mark> --password=<mark style=\"background-color:rgba(0, 0, 0, 0);color:#ade5fc\" class=\"has-inline-color\">$mysqlPW<\/mark> -t -e <mark style=\"background-color:rgba(0, 0, 0, 0);color:#a2fca2\" class=\"has-inline-color\">\"SELECT count(DISTINCT table_schema)\n FROM information_schema.tables \n WHERE table_schema \n NOT IN ('mysql','information_schema','sys','performance_schema');\"<\/mark><\/code><\/pre>\n\n\n\n<p>Some of you might be thinking, &#8220;Why don&#8217;t I just connect remotely and tee all of the commands?&#8221; Well, you can do that, but you can&#8217;t run any of the AWS commands that describe the RDS instance. In a bash script uploaded onto AWS Cloudshell, you can run both the MySQL and AWS commands with one output to review all the information in one place.<\/p>\n\n\n\n<p>If you need help getting started in AWS, VDBA can assist. Contact a <a href=\"https:\/\/virtual-dba.com\/contact-us\/\">sales rep<\/a> to get more information.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Amazon RDS (Relational Database Service) for MySQL is a fully managed database service designed to simplify the deployment, management, and scaling of MySQL databases in the cloud. The service is an attractive option because of its high availability and durability through automated backups, automated software patching, and the option to create read replicas for improved [&hellip;]<\/p>\n","protected":false},"author":49,"featured_media":242185,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"off","_et_pb_old_content":"","_et_gb_content_width":"","content-type":"","footnotes":""},"categories":[4209,4166,39],"tags":[4043,40],"class_list":["post-242179","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aws","category-blog","category-mysql","tag-aws","tag-mysql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.1 (Yoast SEO v27.1.1) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Running MySQL Commands in AWS Cloudshell: 1st Step to Creating Bash Script<\/title>\n<meta name=\"description\" content=\"Learn how to simplify MySQL database management in AWS with CloudShell and CloudWatch, and enhance monitoring with a custom bash script.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Running MySQL Commands in AWS Cloudshell: 1st Step to Creating a Bash Script\" \/>\n<meta property=\"og:description\" content=\"Learn how to simplify MySQL database management in AWS with CloudShell and CloudWatch, and enhance monitoring with a custom bash script.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/\" \/>\n<meta property=\"og:site_name\" content=\"Virtual-DBA Remote DBA Services &amp; Support - Certified Database Experts\" \/>\n<meta property=\"article:published_time\" content=\"2024-04-04T22:27:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-06T01:26:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/virtual-dba.com\/wp-content\/uploads\/Running-MySQL-Commands-in-AWS-Cloudshell-1st-Step-to-Creating-a-Bash-Script.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"557\" \/>\n\t<meta property=\"og:image:height\" content=\"291\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Monica Silva\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@virtual_dba\" \/>\n<meta name=\"twitter:site\" content=\"@virtual_dba\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Monica Silva\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/\"},\"author\":{\"name\":\"Monica Silva\",\"@id\":\"https:\/\/virtual-dba.com\/#\/schema\/person\/9326f6340815aef31d91f56e4ba145da\"},\"headline\":\"Running MySQL Commands in AWS Cloudshell: 1st Step to Creating a Bash Script\",\"datePublished\":\"2024-04-04T22:27:00+00:00\",\"dateModified\":\"2024-04-06T01:26:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/\"},\"wordCount\":741,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/virtual-dba.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/virtual-dba.com\/wp-content\/uploads\/Running-MySQL-Commands-in-AWS-Cloudshell-1st-Step-to-Creating-a-Bash-Script.jpg\",\"keywords\":[\"AWS\",\"mysql\"],\"articleSection\":[\"AWS\",\"Blog\",\"MySQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/\",\"url\":\"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/\",\"name\":\"Running MySQL Commands in AWS Cloudshell: 1st Step to Creating Bash Script\",\"isPartOf\":{\"@id\":\"https:\/\/virtual-dba.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/virtual-dba.com\/wp-content\/uploads\/Running-MySQL-Commands-in-AWS-Cloudshell-1st-Step-to-Creating-a-Bash-Script.jpg\",\"datePublished\":\"2024-04-04T22:27:00+00:00\",\"dateModified\":\"2024-04-06T01:26:25+00:00\",\"description\":\"Learn how to simplify MySQL database management in AWS with CloudShell and CloudWatch, and enhance monitoring with a custom bash script.\",\"breadcrumb\":{\"@id\":\"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/#primaryimage\",\"url\":\"https:\/\/virtual-dba.com\/wp-content\/uploads\/Running-MySQL-Commands-in-AWS-Cloudshell-1st-Step-to-Creating-a-Bash-Script.jpg\",\"contentUrl\":\"https:\/\/virtual-dba.com\/wp-content\/uploads\/Running-MySQL-Commands-in-AWS-Cloudshell-1st-Step-to-Creating-a-Bash-Script.jpg\",\"width\":557,\"height\":291,\"caption\":\"Running MySQL Commands in AWS Cloudshell: 1st Step to Creating a Bash Script\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/virtual-dba.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Running MySQL Commands in AWS Cloudshell: 1st Step to Creating a Bash Script\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/virtual-dba.com\/#website\",\"url\":\"https:\/\/virtual-dba.com\/\",\"name\":\"Virtual-DBA Remote DBA Services &amp; Support - Certified Database Experts\",\"description\":\"Remote Database Administration\",\"publisher\":{\"@id\":\"https:\/\/virtual-dba.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/virtual-dba.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/virtual-dba.com\/#organization\",\"name\":\"Virtual-DBA: Remote DBA | Remote Database Administration\",\"alternateName\":\"Virtual-DBA powered by XTIVIA\",\"url\":\"https:\/\/virtual-dba.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/virtual-dba.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/virtual-dba.com\/wp-content\/uploads\/V-DBA-Database-Services-and-Support-Featured-Logo.jpg\",\"contentUrl\":\"https:\/\/virtual-dba.com\/wp-content\/uploads\/V-DBA-Database-Services-and-Support-Featured-Logo.jpg\",\"width\":557,\"height\":291,\"caption\":\"Virtual-DBA: Remote DBA | Remote Database Administration\"},\"image\":{\"@id\":\"https:\/\/virtual-dba.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/virtual_dba\",\"https:\/\/www.linkedin.com\/showcase\/36220649\/\",\"https:\/\/www.youtube.com\/channel\/UCx3AIeUQ2ziTLKZSJDZ-SEg\"],\"description\":\"Eliminate database downtime and spiraling costs with XTIVIA\u2019s Virtual-DBA. In today\u2019s always-on business world, gaps in 24x7 on-call DBA support, neglected maintenance and security, or a stretched team struggling with overwhelming workloads can lead to costly disruptions and threaten business continuity. XTIVIA\u2019s Virtual-DBA provides the immediate, expert database administration you need, exactly when you need it, ensuring optimal performance, ironclad security, and significant cost savings without the burden of expanding your in-house team. The goal of Virtual-DBA is to provide a cost-effective solution for organizations seeking to optimize the security, management, maintenance, availability, and performance of their critical business systems, whether self-managed or cloud-managed (e.g., AWS RDS, Azure SQL Database). We accomplish this through a comprehensive remote DBA service offering designed specifically to meet the Oracle\u00ae, DB2\u00ae, Informix\u00ae, MySQL\u2122, PostgreSQL\u00ae, MongoDB\u00ae, MariaDB, and Microsoft SQL Server\u00ae, CockroachDB, Databricks, AWS, and Azure needs of our clients.\",\"email\":\"info@xtivia.com\",\"telephone\":\"8886853101\",\"legalName\":\"XTIVIA, Inc\",\"foundingDate\":\"1992-05-01\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"201\",\"maxValue\":\"500\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/virtual-dba.com\/#\/schema\/person\/9326f6340815aef31d91f56e4ba145da\",\"name\":\"Monica Silva\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/virtual-dba.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9af003bf84c81e7a65a1816bc03fa96f866c8d4432b67dec463ef4fbcbe2d65d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9af003bf84c81e7a65a1816bc03fa96f866c8d4432b67dec463ef4fbcbe2d65d?s=96&d=mm&r=g\",\"caption\":\"Monica Silva\"},\"url\":\"https:\/\/virtual-dba.com\/author\/monica-silva\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Running MySQL Commands in AWS Cloudshell: 1st Step to Creating Bash Script","description":"Learn how to simplify MySQL database management in AWS with CloudShell and CloudWatch, and enhance monitoring with a custom bash script.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/","og_locale":"en_US","og_type":"article","og_title":"Running MySQL Commands in AWS Cloudshell: 1st Step to Creating a Bash Script","og_description":"Learn how to simplify MySQL database management in AWS with CloudShell and CloudWatch, and enhance monitoring with a custom bash script.","og_url":"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/","og_site_name":"Virtual-DBA Remote DBA Services &amp; Support - Certified Database Experts","article_published_time":"2024-04-04T22:27:00+00:00","article_modified_time":"2024-04-06T01:26:25+00:00","og_image":[{"width":557,"height":291,"url":"https:\/\/virtual-dba.com\/wp-content\/uploads\/Running-MySQL-Commands-in-AWS-Cloudshell-1st-Step-to-Creating-a-Bash-Script.jpg","type":"image\/jpeg"}],"author":"Monica Silva","twitter_card":"summary_large_image","twitter_creator":"@virtual_dba","twitter_site":"@virtual_dba","twitter_misc":{"Written by":"Monica Silva","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/#article","isPartOf":{"@id":"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/"},"author":{"name":"Monica Silva","@id":"https:\/\/virtual-dba.com\/#\/schema\/person\/9326f6340815aef31d91f56e4ba145da"},"headline":"Running MySQL Commands in AWS Cloudshell: 1st Step to Creating a Bash Script","datePublished":"2024-04-04T22:27:00+00:00","dateModified":"2024-04-06T01:26:25+00:00","mainEntityOfPage":{"@id":"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/"},"wordCount":741,"commentCount":0,"publisher":{"@id":"https:\/\/virtual-dba.com\/#organization"},"image":{"@id":"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/#primaryimage"},"thumbnailUrl":"https:\/\/virtual-dba.com\/wp-content\/uploads\/Running-MySQL-Commands-in-AWS-Cloudshell-1st-Step-to-Creating-a-Bash-Script.jpg","keywords":["AWS","mysql"],"articleSection":["AWS","Blog","MySQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/","url":"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/","name":"Running MySQL Commands in AWS Cloudshell: 1st Step to Creating Bash Script","isPartOf":{"@id":"https:\/\/virtual-dba.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/#primaryimage"},"image":{"@id":"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/#primaryimage"},"thumbnailUrl":"https:\/\/virtual-dba.com\/wp-content\/uploads\/Running-MySQL-Commands-in-AWS-Cloudshell-1st-Step-to-Creating-a-Bash-Script.jpg","datePublished":"2024-04-04T22:27:00+00:00","dateModified":"2024-04-06T01:26:25+00:00","description":"Learn how to simplify MySQL database management in AWS with CloudShell and CloudWatch, and enhance monitoring with a custom bash script.","breadcrumb":{"@id":"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/#primaryimage","url":"https:\/\/virtual-dba.com\/wp-content\/uploads\/Running-MySQL-Commands-in-AWS-Cloudshell-1st-Step-to-Creating-a-Bash-Script.jpg","contentUrl":"https:\/\/virtual-dba.com\/wp-content\/uploads\/Running-MySQL-Commands-in-AWS-Cloudshell-1st-Step-to-Creating-a-Bash-Script.jpg","width":557,"height":291,"caption":"Running MySQL Commands in AWS Cloudshell: 1st Step to Creating a Bash Script"},{"@type":"BreadcrumbList","@id":"https:\/\/virtual-dba.com\/blog\/running-mysql-commands-in-aws-cloudshell-1st-step-to-creating-bash-script\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/virtual-dba.com\/"},{"@type":"ListItem","position":2,"name":"Running MySQL Commands in AWS Cloudshell: 1st Step to Creating a Bash Script"}]},{"@type":"WebSite","@id":"https:\/\/virtual-dba.com\/#website","url":"https:\/\/virtual-dba.com\/","name":"Virtual-DBA Remote DBA Services &amp; Support - Certified Database Experts","description":"Remote Database Administration","publisher":{"@id":"https:\/\/virtual-dba.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/virtual-dba.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/virtual-dba.com\/#organization","name":"Virtual-DBA: Remote DBA | Remote Database Administration","alternateName":"Virtual-DBA powered by XTIVIA","url":"https:\/\/virtual-dba.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/virtual-dba.com\/#\/schema\/logo\/image\/","url":"https:\/\/virtual-dba.com\/wp-content\/uploads\/V-DBA-Database-Services-and-Support-Featured-Logo.jpg","contentUrl":"https:\/\/virtual-dba.com\/wp-content\/uploads\/V-DBA-Database-Services-and-Support-Featured-Logo.jpg","width":557,"height":291,"caption":"Virtual-DBA: Remote DBA | Remote Database Administration"},"image":{"@id":"https:\/\/virtual-dba.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/virtual_dba","https:\/\/www.linkedin.com\/showcase\/36220649\/","https:\/\/www.youtube.com\/channel\/UCx3AIeUQ2ziTLKZSJDZ-SEg"],"description":"Eliminate database downtime and spiraling costs with XTIVIA\u2019s Virtual-DBA. In today\u2019s always-on business world, gaps in 24x7 on-call DBA support, neglected maintenance and security, or a stretched team struggling with overwhelming workloads can lead to costly disruptions and threaten business continuity. XTIVIA\u2019s Virtual-DBA provides the immediate, expert database administration you need, exactly when you need it, ensuring optimal performance, ironclad security, and significant cost savings without the burden of expanding your in-house team. The goal of Virtual-DBA is to provide a cost-effective solution for organizations seeking to optimize the security, management, maintenance, availability, and performance of their critical business systems, whether self-managed or cloud-managed (e.g., AWS RDS, Azure SQL Database). We accomplish this through a comprehensive remote DBA service offering designed specifically to meet the Oracle\u00ae, DB2\u00ae, Informix\u00ae, MySQL\u2122, PostgreSQL\u00ae, MongoDB\u00ae, MariaDB, and Microsoft SQL Server\u00ae, CockroachDB, Databricks, AWS, and Azure needs of our clients.","email":"info@xtivia.com","telephone":"8886853101","legalName":"XTIVIA, Inc","foundingDate":"1992-05-01","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"201","maxValue":"500"}},{"@type":"Person","@id":"https:\/\/virtual-dba.com\/#\/schema\/person\/9326f6340815aef31d91f56e4ba145da","name":"Monica Silva","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/virtual-dba.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9af003bf84c81e7a65a1816bc03fa96f866c8d4432b67dec463ef4fbcbe2d65d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9af003bf84c81e7a65a1816bc03fa96f866c8d4432b67dec463ef4fbcbe2d65d?s=96&d=mm&r=g","caption":"Monica Silva"},"url":"https:\/\/virtual-dba.com\/author\/monica-silva\/"}]}},"_links":{"self":[{"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/posts\/242179","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/users\/49"}],"replies":[{"embeddable":true,"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/comments?post=242179"}],"version-history":[{"count":0,"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/posts\/242179\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/media\/242185"}],"wp:attachment":[{"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/media?parent=242179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/categories?post=242179"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/virtual-dba.com\/wp-json\/wp\/v2\/tags?post=242179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}