<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: vladi160</title>
    <description>The latest articles on DEV Community by vladi160 (@vladi160).</description>
    <link>https://dev.to/vladi160</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F383136%2Fc21118a3-55b7-4723-b493-f821182eb502.JPG</url>
      <title>DEV Community: vladi160</title>
      <link>https://dev.to/vladi160</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vladi160"/>
    <language>en</language>
    <item>
      <title>Steps to Recover MySQL Root Password</title>
      <dc:creator>vladi160</dc:creator>
      <pubDate>Sun, 25 Jun 2023 11:37:54 +0000</pubDate>
      <link>https://dev.to/vladi160/steps-to-recover-mysql-root-password-7d1</link>
      <guid>https://dev.to/vladi160/steps-to-recover-mysql-root-password-7d1</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;It's not uncommon to lose or forget the MySQL root password, especially if you haven't accessed your server in a while. The following guide provides a step-by-step process for recovering the MySQL root password on an Ubuntu system. We'll also cover some common issues you might encounter during the process and how to address them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stop the MySQL service
&lt;/h2&gt;

&lt;p&gt;The first step is to stop the currently running MySQL service. You can do this by running the following command in the terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl stop mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Start MySQL
&lt;/h2&gt;

&lt;p&gt;Next, you'll need to start the MySQL server without a password. The --skip-grant-tables option allows us to connect to MySQL without a password and with all privileges.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mysqld_safe --skip-grant-tables &amp;amp;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Note: If you face the issue of "Directory '/var/run/mysqld' for UNIX socket file don't exist", you can resolve it by creating the directory:&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mkdir /var/run/mysqld
sudo chown mysql:mysql /var/run/mysqld
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Log in to MySQL without a password
&lt;/h2&gt;

&lt;p&gt;Now, you should be able to connect to MySQL as the root user without a password:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mysql -u root
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Change the root password
&lt;/h2&gt;

&lt;p&gt;After successfully logging into MySQL, use the following SQL command to change the root password:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ALTER USER 'root'@'localhost' IDENTIFIED BY 'New-Password';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace 'New-Password' with your new root password. Then exit the MySQL shell by typing exit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stop the MySQL service
&lt;/h2&gt;

&lt;p&gt;Now, stop the MySQL service which is running without password verification:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mysqladmin -u root -p -S /var/run/mysqld/mysqld.sock shutdown
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When prompted, enter the new MySQL root password that you set earlier.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start the MySQL service
&lt;/h2&gt;

&lt;p&gt;Finally, start the MySQL service as usual:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl start mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Moving an EC2 instance from one AWS account to another.</title>
      <dc:creator>vladi160</dc:creator>
      <pubDate>Sun, 07 May 2023 17:04:19 +0000</pubDate>
      <link>https://dev.to/vladi160/moving-an-ec2-instance-from-one-aws-account-to-another-5e7d</link>
      <guid>https://dev.to/vladi160/moving-an-ec2-instance-from-one-aws-account-to-another-5e7d</guid>
      <description>&lt;p&gt;Moving an EC2 instance from one AWS account to another can be done by following these steps. Please note that you will need access to both the source and destination AWS accounts to complete this process.&lt;/p&gt;

&lt;p&gt;Create an Amazon Machine Image (AMI) of the EC2 instance:&lt;/p&gt;

&lt;p&gt;a. In the source AWS account, go to the EC2 Management Console.&lt;br&gt;
b. Select the instance you want to move.&lt;br&gt;
c. Click on 'Actions', then select 'Create Image'.&lt;br&gt;
d. Provide a unique name and description for the image and click 'Create Image'.&lt;br&gt;
e. Wait for the AMI creation process to complete.&lt;/p&gt;

&lt;p&gt;Share the AMI with the destination AWS account:&lt;/p&gt;

&lt;p&gt;a. In the source AWS account, go to the 'AMIs' section of the EC2 Management Console.&lt;br&gt;
b. Select the newly created AMI.&lt;br&gt;
c. Click on 'Actions', then select 'Modify Image Permissions'.&lt;br&gt;
d. Enter the destination AWS account ID and click 'Add Permission'.&lt;br&gt;
e. Save the changes.&lt;/p&gt;

&lt;p&gt;Launch a new EC2 instance in the destination AWS account:&lt;/p&gt;

&lt;p&gt;a. In the destination AWS account, go to the EC2 Management Console.&lt;br&gt;
b. Click on 'Launch Instance'.&lt;br&gt;
c. Select 'My AMIs' from the left-hand menu.&lt;br&gt;
d. Choose the shared AMI from the source account and click 'Select'.&lt;br&gt;
e. Follow the standard process to configure and launch the new EC2 instance.&lt;/p&gt;

&lt;p&gt;a. After verifying that the new EC2 instance is working correctly, terminate the old instance in the source account to avoid incurring unnecessary charges.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>tips</category>
    </item>
  </channel>
</rss>
