One of our MySQL server(5.5.x) crashed but fortunately we have setup the backup of it. I have built the new server with MySQL(5.7.34) and restored the backup on it but when I tried to run any query like creating new user(s) etc got an error something like:
ERROR 1728 (HY000): Cannot load from mysql.db. The table is probably corrupted
This happens due to the schema changes required for different MySQL server versions. The simple fix to this problem recommended by MySQL is to run the mysql_upgrade command from the command line. mysql_upgrade checks all tables across all databases for incompatibilities with the current version of MySQL. mysql_upgrade also upgrades the system tables so that we can take advantage of new privileges or capabilities that might have been added. It supersedes the older mysql_fix_privilege_tables script, which should no longer be used.
[IMPORTANT NOTE] Before running mysql_upgrade command on production server, it’s always a good practice to take a full backup of all the databases first, just in case something goes wrong.
I tried to run mysql_upgrade command from terminal:
mysql_upgrade -uroot -p
After entering the command, got this error message:
Note: I am not mentioning mysql username and password in the command because I am using .my.cnf configuration
mysql_upgrade will perform a weaker verification. If the result is not equal to 1, then mysql_upgrade cannot be executed.
In this short tutorial we’ll learn how to create or delete the linux user accounts with public ssh keys associated with their Github accounts using Ansible, so please create a Github account if you don’t already have one, and follow the instructions for associated SSH keys with your account, if you didn’t perform it already.
Ansible has an excellent feature called ansible-pull, which many people don’t know or don’t use. This feature works best for self healing infrastructure, best example is AWS Autoscaling in which new ec2 instance is created from vanilla ami, then pull the code from somewhere (version control system) and configure itself before announcing that it is ready to serve (mean add to the serving ELB).
The steps for ansible-pull are:
1. Pull the git repo containing your playbooks.
2. That repo is cloned to the mentioned directory.
3. ansible-pull starts executing the local.yml found in your cloned repo directory.
Let’s assume that you want to pull the code from the private git repo and for this you need the ssh private key but you have taken the updated vanilla ubuntu ami from the Marketplace, then how you will clone this private repo? For this we’ll use the Bootstrap Pattern:
– Put the private part of ssh key for the git repository on S3.
– Getting ssh key from s3 bucket using IAM role credentials
For this, create a S3 bucket(in my case it is named “tendo-github-key-s3“):
In this post,we’ll create the Infrastructure for Highly-Available WordPress website over AWS using Terraform and then install the WordPress using Ansible. If you don’t know about the Terraform, please check this link.
We’ll use the Terraform to create the fully operational AWS VPC infrastructure(subnets,routeing tables,igw etc), it will also create everything that need to be for creating EC2 and RDS instances (security key, security group, subnet group). It will also create the Elastic Load Balancer and add the EC2 instance(s) automatically to it as well as creating the Route53 entry for this wordpress site and add the ELB alias to it.
Ansible will be used to deploy the wordpress on the EC2 instances that have been created via Terraform, that will be fault tolerant and highly available.
In this post,we’ll learn that how we can install the latest LEMP (Nginx, MySQL & PHP) Stack and it’s initial configuration on Ubuntu 14.04 LTS using Ansible. If you don’t know about Ansible, please check this link.
If you want the manual procedure to install the LEMP stack, please refer this link.
In this Simple tutorial, I’ll show you that how you can use the Vagrant with Ansible to provision and configure the EC2 instance on AWS. I am assuming that you already have Vagrant installed and have an AWS account(and know how to use both).
Ansible is a configuration management and provisioning tool, similar to Chef, Puppet or Salt. It’s one of the simplest and the easiest to get started with because it’s “just SSH”; It uses SSH to connect to servers and run the configured Tasks.