1. 下载:
2. 解压,然后复制到需要的目录下
3. 修改 /usr/local/mysql的所有者为mysql: chown -R mysql:mysql mysql (这一步我是没做,爱做不做。)
4. 安装mysql ? : sudo mysql/scripts/mysql_install_db 
mjorcendeMacBook-Air:mysql-5.6.22-osx10.9-x86_64 mjorcen$ sudo scripts/mysql_install_db 
Password:
Installing MySQL system tables...2015-10-09 15:32:23 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-10-09 15:32:23 6814 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-10-09 15:32:23 6814 [Note] InnoDB: The InnoDB memory heap is disabled
2015-10-09 15:32:23 6814 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-10-09 15:32:23 6814 [Note] InnoDB: Memory barrier is not used
2015-10-09 15:32:23 6814 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-10-09 15:32:23 6814 [Note] InnoDB: Using CPU crc32 instructions
2015-10-09 15:32:23 6814 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-10-09 15:32:23 6814 [Note] InnoDB: Completed initialization of buffer pool
2015-10-09 15:32:23 6814 [Note] InnoDB: Highest supported file format is Barracuda.
2015-10-09 15:32:23 6814 [Note] InnoDB: The log sequence numbers 5937121 and 5937121 in ibdata files do not match the log sequence number 5937131 in the ib_logfiles!
2015-10-09 15:32:23 6814 [Note] InnoDB: Database was not shutdown normally!
2015-10-09 15:32:23 6814 [Note] InnoDB: Starting crash recovery.
2015-10-09 15:32:23 6814 [Note] InnoDB: Reading tablespace information from the .ibd files...
2015-10-09 15:32:23 6814 [Note] InnoDB: Restoring possible half-written data pages 
2015-10-09 15:32:23 6814 [Note] InnoDB: from the doublewrite buffer...
2015-10-09 15:32:23 6814 [Note] InnoDB: 128 rollback segment(s) are active.
2015-10-09 15:32:23 6814 [Note] InnoDB: Waiting for purge to start
2015-10-09 15:32:23 6814 [Note] InnoDB: 5.6.22 started; log sequence number 5937131
2015-10-09 15:32:24 6814 [Note] Binlog end
2015-10-09 15:32:24 6814 [Note] InnoDB: FTS optimize thread exiting.
2015-10-09 15:32:24 6814 [Note] InnoDB: Starting shutdown...
2015-10-09 15:32:25 6814 [Note] InnoDB: Shutdown completed; log sequence number 5937141
OK

Filling help tables...2015-10-09 15:32:25 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-10-09 15:32:25 6815 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-10-09 15:32:25 6815 [Note] InnoDB: The InnoDB memory heap is disabled
2015-10-09 15:32:25 6815 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-10-09 15:32:25 6815 [Note] InnoDB: Memory barrier is not used
2015-10-09 15:32:25 6815 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-10-09 15:32:25 6815 [Note] InnoDB: Using CPU crc32 instructions
2015-10-09 15:32:25 6815 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-10-09 15:32:25 6815 [Note] InnoDB: Completed initialization of buffer pool
2015-10-09 15:32:25 6815 [Note] InnoDB: Highest supported file format is Barracuda.
2015-10-09 15:32:25 6815 [Note] InnoDB: 128 rollback segment(s) are active.
2015-10-09 15:32:25 6815 [Note] InnoDB: Waiting for purge to start
2015-10-09 15:32:25 6815 [Note] InnoDB: 5.6.22 started; log sequence number 5937141
2015-10-09 15:32:25 6815 [Note] Binlog end
2015-10-09 15:32:25 6815 [Note] InnoDB: FTS optimize thread exiting.
2015-10-09 15:32:25 6815 [Note] InnoDB: Starting shutdown...
2015-10-09 15:32:26 6815 [Note] InnoDB: Shutdown completed; log sequence number 5937167
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

  ./bin/mysqladmin -u root password 'new-password'
  ./bin/mysqladmin -u root -h mjorcendeMacBook-Air.local password 'new-password'

Alternatively you can run:

  ./bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

  cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

  cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

WARNING: Found existing config file ./my.cnf on the system.
Because this file might be in use, it was not replaced,
but was used in bootstrap (unless you used --defaults-file)
and when you later start the server.
The new default config file was created as ./my-new.cnf,
please compare it with your file and take the changes you need.

mjorcendeMacBook-Air:mysql-5.6.22-osx10.9-x86_64 mjorcen$ 

看上面的内容。 很明显,我成功了。

5. 至此,可以运行mysql服务器端了: sudo  mysql/bin/mysqld_safe &   (&在Unix系统里并不会在后台运行,尤其是使用像tomcat时非常有用,可以看得到输出的信息)
mysqld_multi  mysqld_safe   
mjorcendeMacBook-Air:mysql-5.6.22-osx10.9-x86_64 mjorcen$ bin/mysqld_safe &
[1] 6820
mjorcendeMacBook-Air:mysql-5.6.22-osx10.9-x86_64 mjorcen$ 151009 15:37:37 mysqld_safe Logging to '/Users/mjorcen/Workspaces/mysql-5.6.22-osx10.9-x86_64/data/mjorcendeMacBook-Air.local.err'.
151009 15:37:37 mysqld_safe Starting mysqld daemon with databases from /Users/mjorcen/Workspaces/mysql-5.6.22-osx10.9-x86_64/data

 

 
6. 运行mysql客户端:  mysql/bin/mysql -u root -p
mjorcendeMacBook-Air:mysql-5.6.22-osx10.9-x86_64 mjorcen$ mysql
-bash: mysql: command not found
mjorcendeMacBook-Air:mysql-5.6.22-osx10.9-x86_64 mjorcen$ bin/mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.22 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, 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.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| test               |
| test_one           |
+--------------------+
3 rows in set (0.01 sec)

mysql> 

 

 

posted @ 2015-10-09 15:39 mjorcen 阅读(565) 评论(0) 推荐(0) 编辑
摘要: 磁盘 I/O 优化1. 性能检测 我们的应用程序通常都需要访问磁盘系统,而磁盘 I/O 通常都很耗时, 要判断 I/O 是否是一个瓶颈,有一些参数指标可以参考. 我们可以压力测试应用程序看系统的 I/Owait 指标是否正常. 例如,测试服务器有4个 CPU, 那么理想的 I/O wait 参数... 阅读全文
posted @ 2015-07-13 17:17 mjorcen 阅读(1353) 评论(0) 推荐(0) 编辑
摘要: 代码:Serverpackage netty.protocol.websocket.server;import io.netty.bootstrap.ServerBootstrap;import io.netty.channel.Channel;import io.netty.channel.Cha... 阅读全文
posted @ 2015-06-03 17:37 mjorcen 阅读(1958) 评论(0) 推荐(0) 编辑
摘要: 1. WebSocket 协议开发. WebSocket 是 HTML5 开始提供的一种浏览器与服务器间进行全双工通讯的网络技术,WebSocket通信协议于2011年被IETF定为标准 RFC6455 , WebSocket API 被W3C定为标准. 在 WebSocket API中,浏览器... 阅读全文
posted @ 2015-06-03 16:38 mjorcen 阅读(328) 评论(0) 推荐(0) 编辑
摘要: 一. HTTP 简介 HTTP(超文本传输协议) 协议是建立在 TCP 传输协议之上的应用层协议,它的发展是万维网协会和 Internet 工作小组和 IETF 合作的结果. HTTP 是一个属于应用层的面向对象的协议,由于其便捷,快速的方式,适用于分布式超媒体信息系统. HTTP 协议的主要特... 阅读全文
posted @ 2015-06-02 01:33 mjorcen 阅读(1941) 评论(0) 推荐(0) 编辑
摘要: 一.JBoss Marshalling 简介. JBoss Marshalling 是一个Java 对象序列化包,对 JDK 默认的序列化框架进行了优化,但又保持跟 Java.io.Serializable 接口的兼容,同时增加了一些可调的参数和附件的特性, 这些参数和附加的特性, 这些参数和特性... 阅读全文
posted @ 2015-06-02 00:55 mjorcen 阅读(3289) 评论(0) 推荐(0) 编辑
摘要: package object.server.impl;import io.netty.bootstrap.ServerBootstrap;import io.netty.channel.ChannelFuture;import io.netty.channel.ChannelInitializer;... 阅读全文
posted @ 2015-06-01 23:53 mjorcen 阅读(4382) 评论(0) 推荐(0) 编辑
摘要: 根据上一篇博文Google Protobuf 使用 Java 版netty 集成 protobuf 的方法非常简单.代码如下:serverpackage protobuf.server.impl;import io.netty.bootstrap.ServerBootstrap;import io.... 阅读全文
posted @ 2015-06-01 22:57 mjorcen 阅读(1026) 评论(0) 推荐(0) 编辑
摘要: 一 . Protobuf 的入门 Protobuf 是一个灵活,高效,结构化的数据序列化框架, 相比于 XML 等传统的序列化工具,它更小,更快,更灵活,更简单.Protobuf 支持数据结构化一次可以到处使用.甚至跨语言使用.同通过代码生成工具可以自动生成不同语言版本的源代码,甚至可以在使用不同... 阅读全文
posted @ 2015-06-01 22:48 mjorcen 阅读(12424) 评论(0) 推荐(1) 编辑
摘要: 粘包问题的解决策略 由于底层的 TCP 无法理解上层业务数据,所以在底层是无法保证数据包不被拆分和重组的, 这个问题只能通过上层的应用协议栈设计来解决,根据业界主流的协议的解决方案, 可以归纳如下:消息定长, 例如每个报文的大小固定长度200字节,如果不够,空位补齐空格;在包尾部添加回车换行符进行... 阅读全文
posted @ 2015-05-29 18:19 mjorcen 阅读(1138) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示