MemSQL翻译第三天---MemSQL指导

翻译 2016年08月30日 10:48:41

原文地址 http://docs.memsql.com/docs/tutorials-overview

How to Connect to MemSQL This section outlines several ways to connect to MemSQL using popular MySQL-compatible clients and libraries.

如何连接数据库
这一节列出了几种MySQL兼容的客户端和类课连接MemSQL的方式

MySQL command-line client MemSQL is wire-compliant with MySQL meaning connecting to MemSQL is as easy as connecting to the MySQL database. You may need the -u user, -h host, and -P port flags to ensure you are connecting to MemSQL properly. For example: Connecting with MySQL
client mysql -u root -h 127.0.0.1 -P 3306

MemSQL命令行客户端
MemSQL和MySQL是兼容的,意味着连接MemSQL和连接MySQL是一样方便的,你可能需要-u user,-h host,-P port来确信你能连接到MemSQL,例如:
mysql -u root -h 127.0.0.1 -P 3306

Here we have -u root to specify login as user root, -h 127.0.0.1 to
connect to the MemSQL host at localhost, and -P 3306 to connect to
MemSQL on port 3306.

If you also have MySQL installed, the mysql client may connect to
MySQL instead of MemSQL by default if you do not specify the
appropriate host and port options. If you attempt to connect to MemSQL
on localhost, even if you specify the correct port, the mysql client
may still attempt to connect to MySQL with default configuration. See
this FAQ item on ERROR 2002.

如果你也安装了MySQL,如果你没有使用主机名和端口号,mysql客户端可能连接到MySQL而不是MemSQL,如果你试着在localhost上连接MemSQL,
mysql客户端可能仍然试着连接MySQL,http://docs.memsql.com/docs/memsql-faq#section-what-is-error-2002-which-appears-when-connecting-to-memsql-with-the-stock-mysql-client-using-default-arguments-

You may also use the –prompt flag to change the prompt in the
interactive session, simply to help distinguish MemSQL from MySQL:
Changing the prompt mysql -u root -h 127.0.0.1 -P 3306
–prompt=”memsql> ” The output when you connect should look similar to this: Connect SQL Welcome to the MySQL monitor. Commands end with ; or
\g. Your MySQL connection id is 6 Server version: 5.5.8 MemSQL source
distribution (compatible; MySQL Enterprise & MySQL Commercial)
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights
reserved. Oracle is a registered trademark of Oracle Corporation
and/or its affiliates. Other names may be trademarks of their
respective owners. Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear
the current input statement. memsql>

你可能需要使用–prompt来改变交互式session的提示符,这样能把mysql和memsql区分开:
mysql -u root -h 127.0.0.1 -P 3306 –prompt=”memsql> ”
输出看起来大概是这样:

Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL
connection id is 6 Server version: 5.5.8 MemSQL source distribution
(compatible; MySQL Enterprise & MySQL Commercial) Copyright (c) 2000,
2015, Oracle and/or its affiliates. All rights reserved. Oracle is a
registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners. Type ‘help;’
or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
memsql>

These commands show more information about the connection and the
server:

下面的命令给出更多的信息

Additional information mysql> status
————– mysql Ver 14.14 Distrib 5.6.19, for osx10.9 (x86_64) using EditLine wrapper

Connection id: 6 Current database: Current user:
root@127.0.0.1 SSL: Not in use Current pager:
stdout Using outfile: ” Using delimiter: ; Server
version: 5.5.8 MemSQL source distribution (compatible; MySQL
Enterprise & MySQL Commercial) Protocol version: 10 Connection:
127.0.0.1 via TCP/IP Server characterset: utf8 Db characterset: utf8 Client characterset: utf8 Conn. characterset: utf8 TCP port:

3306

mysql> show databases;
+——————–+ | Database |
+——————–+ | information_schema | | memsql | | sharding |
+——————–+ 3 rows in set (0.00 sec)

mysql> show variables like ‘%version%’;
+————————-+——————————————————————————+ | Variable_name | Value
|
+————————-+——————————————————————————+ | memsql_version | 4.0
| | memsql_version_date | Wed May 6 09:07:03 2015 -0700
| | memsql_version_hash | 0cba132fba0ba7650c1bc9aeec8c1fc381def395
| | protocol_version | 10
| | version | 5.5.8
| | version_comment | MemSQL source distribution (compatible;
MySQL Enterprise & MySQL Commercial) | | version_compile_machine |
x86_64
| | version_compile_os | Linux
|
+————————-+——————————————————————————+ 8 rows in set (0.03 sec)

mysql> show status like ‘%license%’;
+—————+———————————-+ | Variable_name | Value |
+—————+———————————-+ | License_key | 5ca1ab1e000f40aaa6cb67b2ea3ee466 | | License_type | enterprise
|
+—————+———————————-+ 2 rows in set (0.00 sec)

mysql> show status like ‘%cluster_capacity%’;
+————————–+————-+ | Variable_name | Value |
+————————–+————-+ | Maximum_cluster_capacity | 10000000 MB | | Used_cluster_capacity | 107957 MB |
+————————–+————-+ 2 rows in set (0.00 sec)

The @@version and @@version_comment global variables are for
compatibility with MySQL clients, which expect certain minimum
version numbers and strings to be present. To check the real version
of MemSQL you are running, use the @@memsql_version variables
instead. To check the license you are running, see the license_key and
license_type status codes.

全局变量@@version和@@version_comment是为了和MySQL兼容,代表着当前最小的版本,为了得到你的真正的版本,使用@@memsql_version变量,为了
产看你正在运行的许可,看license_key和license_type。

Hibernate You will need JDBC in your classpath to connect to MemSQL.
Make sure you have Hibernate and Maven properly installed. Download
HibernateTutorial.zip. Unzip HibernateTutorial. Initialize your
database. Initialize the database CREATE DATABASE test; USE test;
CREATE TABLE USER (
-> USER_ID INT (5) NOT NULL,
-> USERNAME VARCHAR (20) NOT NULL,
-> CREATED_BY VARCHAR (20) NOT NULL,
-> CREATED_DATE DATE NOT NULL,
-> PRIMARY KEY ( USER_ID )
-> ); Edit HibernateTutorial/src/main/java/resources/hibernate.cfg.xml to match
your MemSQL configuration. For example our user is root with no
password. Our database is on localhost on port 3306. Hibernate
configuration

MemSQL、SQLFire、Oracle XE性能对比测试

MemSQL、SQLFire、Oracle XE性能对比测试
  • zcmssd
  • zcmssd
  • 2014年09月12日 14:20
  • 3493

MemSQL性能测试结果

1.查询的SQLselect count(subie.user_id) as count from sum_user_basic_info_exp subie join sum_user_l...
  • current_person
  • current_person
  • 2016年09月01日 15:15
  • 1637

MemSQL性能测试结果

1.查询的SQLselect count(subie.user_id) as count from sum_user_basic_info_exp subie join sum_user_l...
  • current_person
  • current_person
  • 2016年09月01日 15:15
  • 1637

MemSQL、SQLFire、Oracle XE性能对比测试

MemSQL、SQLFire、Oracle XE性能对比测试
  • zcmssd
  • zcmssd
  • 2014年09月12日 14:20
  • 3493

MemSQL翻译第二天--安装配置优化

Installation Best Practices This section lists the best practices for properly configuring your M...
  • current_person
  • current_person
  • 2016年08月26日 11:13
  • 1403

MemSQL翻译第一天

原文地址:http://docs.memsql.com/docs/memsql-faq MemSQL is the database platform for real-time analy...
  • current_person
  • current_person
  • 2016年08月25日 18:19
  • 1624

hello MemSQL 入门安装示例

MemSQL 号称世界上最快的分布式关系型数据库,兼容MySQL但快30倍,能实现每秒150万次事务hello MemSQL 入门安装示例...
  • joeyon
  • joeyon
  • 2014年08月16日 15:02
  • 1666

MemSQL初体验 - (1)传说中速度最快的关系数据库软件

最快的RDBMS数据库是哪个呢,之前人们会在ORACLE/SYBASE/DB2这类大型软件产品中争论不休,而后MSSQL SERVER/MYSQL这类的中小型数据库软件也加入战场,尽管论战热门非凡,但...
  • liqfyiyi
  • liqfyiyi
  • 2016年11月18日 14:28
  • 535

MemSQL学习笔记-类似MySQL的数据库

http://gigaom.com/cloud/ex-facebookers-launch-memsql-to-make-your-database-fly/ -- 多主-从 http:/...
  • mchdba
  • mchdba
  • 2013年08月26日 00:27
  • 5732

MemSQL初体验 - (3)性能测试

3、性能测试  在执行测试前必须首先说明一下本地的虚拟机测试环境:    MEM:2G   CPU:1 core   OS:CentOS 6.0   配置整体较差,其实是不适合做DB环境...
  • liqfyiyi
  • liqfyiyi
  • 2016年11月18日 14:29
  • 259
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:MemSQL翻译第三天---MemSQL指导
举报原因:
原因补充:

(最多只允许输入30个字)