未加星标

Connecting to Compose for MySQL

字体大小 | |
[数据库(mysql) 所属分类 数据库(mysql) | 发布者 店小二04 | 时间 2016 | 作者 红领巾 ] 0人收藏点击收藏

With Compose for mysql now available as a beta, you'll be eager to get up and running with it. Here, we'll walk through how to set up a deployment and securely connect to it. We will take you from provisioning your own MySQL database to connecting to it within a few minutes. If you are familiar with Compose's other databases, you'll feel right at home with Compose for MySQL.

Preparation

Creating a Compose for MySQL deployment follows the same pattern as all other Compose database deployments. Sign in to your Compose account and then, from the Deployments view, click on Create Deployment and select MySQL from the Beta selection of databases.


Connecting to Compose for MySQL

The Compose system generates a deployment name and selects AWS US-East-1 as the location for the new database deployment. You can change the database name and the data center location; in the latter case selecting from Amazon, Google and SoftLayer data centers around the world. There's also a slider which allows you to select the amount of disk storage your deployment should initially be allocated. You can leave it as is and let Compose's autoscaling system allocate storage as needed, or you can dial in your requirements and configure your deployment with that much space up front. Autoscaling will still work if you manually select your database size. Once the form is filled in, click Create Deployment and Compose will begin provisioning your database. When it's complete you'll see this...


Connecting to Compose for MySQL

You'll find the information needed to connect to your deployment in the Connection info panel. It contains three things: your credentials, which in this case is the password for the admin user, a Connection string which can be used with database drivers to automatically connect, and a Command line which allows you to manually log in to the database.

Connecting to Your Deployment

Your deployment comes with a "compose" database that's created by default. To connect to Compose for MySQL using the command line, you first have to install MySQL on your machine. Each platform has its own installation packages, so choose the one that's right for you. There's Oracle community packages at http://dev.mysql.com/downloads/ . Before you download from there, be aware that linux users will usually find MySQL in their distributions repository. If you're working on a Mac, we recommend you install MySQL using Homebrew using brew install mysql , which will compile and install the latest version of MySQL.

To access your deployment via the terminal, you can copy and paste the command line string provided in the Connection info panel into your terminal to connect to your deployment like:


Connecting to Compose for MySQL

You can ensure that SSL is used when connecting by using --ssl-mode=REQUIRED . The default user is named "admin" which you use as the username in the -u parameter. After running the command, since the password parameter -p has no value, you'll be prompted to enter the admin user's password, which you can get from the credentials section here:


Connecting to Compose for MySQL

Compose for MySQL has SSL enabled by default, but when connecting, we suggest you take extra precautions by using the --ssl-mode=REQUIRED option on the command line. This stops MySQL falling back, for whatever reason, to an unencrypted connection. SSL can be disabled by using --ssl-mode=DISABLED if you want to test unencrypted connections.

If you want to verify which host you're connecting to, you can obtain a self-signed certificate for the MySQL server from the Compose web console. You can use this for verification when establishing a connection:


Connecting to Compose for MySQL

To view the certificate, click on Show certificate . You might be asked for your Compose username and password for re-authentication. Once your password is authenticated, you'll be given a self-signed certificate like this:


Connecting to Compose for MySQL

To use the certificate, create a new file and copy everything from ---BEGIN CERTIFICATE--- to ---END CERTIFICATE--- and save with the .pem extension. This file is used to verify the certificate that the server presents the MySQL command line tool and ensure that the host you are connecting to is the one you expect. To make use of it, change the --ssl-mode to --ssl-mode=VERIFY_CA and add --ssl-ca with the path and name of your .pem file like this:


Connecting to Compose for MySQL

When you've successfully logged in, you should get see something similar to this:


Connecting to Compose for MySQL
Discover Compose for MySQL

Now that we've covered the basics of setting up and connecting to your own MySQL deployment, you have the ability to discover other features of the database and view the benefits of using MySQL on Compose. So, discover what Compose for MySQL can do for you and your organization and tell us what you're building and what you think about it.

本文数据库(mysql)相关术语:navicat for mysql mysql workbench mysql数据库 mysql 存储过程 mysql安装图解 mysql教程 mysql 管理工具

主题: SQLMySQLLinuxTI
分页:12
转载请注明
本文标题:Connecting to Compose for MySQL
本站链接:http://www.codesec.net/view/483215.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 数据库(mysql) | 评论(0) | 阅读(36)