Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>This is how I did it for a couple instances that had data in the MySQl tables.</strong></p> <p>The steps to creating an RDS database instance: <a href="http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_GettingStarted.CreatingConnecting.MySQL.html" rel="noreferrer">http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_GettingStarted.CreatingConnecting.MySQL.html</a></p> <p><em>Note:</em> Make sure the RDS instance has a security group configured that relates to the EC2 security group. <a href="http://docs.amazonwebservices.com/AmazonRDS/latest/UserGuide/USER_Workin" rel="noreferrer">http://docs.amazonwebservices.com/AmazonRDS/latest/UserGuide/USER_Workin</a>...</p> <p>Before we go forward, let me provide a list of what some of the following placeholders are:</p> <ul> <li>host.address.for.rds.server = this will be what is referred to as the "end point" in your RDS description/settings page.</li> <li>rdsusername = the master user account which you created during RDS setup.</li> <li>rdsdatabase = a blank database which you created inside the server on your RDS instance.</li> <li>backupfile.sql = the sql dump file your made of your pre-existing installation's database.</li> </ul> <p>Once you've created a fresh RDS database instance, and have configured its security settings, log into this server (from within an ssh session to your EC2 server) and then create an empty database inside the instance using basic SQL commands.</p> <pre><code>mysql -h host.address.for.rds.server -P 3306 -u rdsusername -p (enter your password) create database rdsdatabase; </code></pre> <p>Then quit out of the MySQL environment inside your RDS server.</p> <pre><code>\q </code></pre> <p>This tutorial assumes you already have a backup from your old database. If you don't, go create one now. After that, you’re ready to import that sql dump file into the empty database waiting on your RDS server.</p> <pre><code>mysql -h host.address.for.rds.server -u rdsusername -p rdsdatabase &lt; backupfile.sql </code></pre> <p>It might take a few seconds to complete, depending on the size of the sql dump file. Your indication that it is finished is that the bash command prompt reappears.</p> <p>Note: the command “mysqlimport” is used when imported data directly into an existing table inside a database. It might seem like we’re “importing” data, but this is not what we’re actually doing in this situation. The database we are migrating to has no tables yet, and the sql dump file we’re using contains the sql commands to generate the tables it needs.</p> <p><strong>Confirm the Transfer</strong></p> <p>Now, if you didn't get any error messages, then your sql transfer probably worked. If you want, you can double check to see if it did by connecting to your RDS database server, looking up the database you created, and check to see if the tables are now present.</p> <pre><code>mysql -h host.address.for.rds.server -P 3306 -u rdsusername -p (enter your password) use rdsdatabase; show tables; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload