Skip to content

Commit

Permalink
docs: add year to licence && mysql docs (eggjs#447)
Browse files Browse the repository at this point in the history
  • Loading branch information
atian25 authored and dead-horse committed Feb 24, 2017
1 parent 80a06fc commit 234ceac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)
MIT License

Copyright (c) Alibaba Group Holding Limited and other contributors.
Copyright (c) 2017 Alibaba Group Holding Limited and other contributors.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
17 changes: 8 additions & 9 deletions docs/source/zh-cn/tutorials/mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,18 @@ title: MySQL

## egg-mysql

我们提供了 [egg-mysql](https://github.com/eggjs/egg-mysql) 插件来访问 MySQL 数据库。这个插件既可以访问普通的 MySQL 数据库,也可以访问基于 MySQL 协议的在线数据库服务。
我们提供了 [egg-mysql] 插件来访问 MySQL 数据库。这个插件既可以访问普通的 MySQL 数据库,也可以访问基于 MySQL 协议的在线数据库服务。

### 安装与配置

`package.json` 里面依赖 egg-mysql 模块,并通过 `config/plugin.js` 配置启动 MySQL 插件:
安装对应的插件 [egg-mysql]

```js
// package.json
{
"dependencies": {
   "egg-mysql": "*"
}
}
```bash
$ npm i --save egg-mysql
```

开启插件:

```js
// config/plugin.js
exports.mysql = {
Expand Down Expand Up @@ -356,3 +353,5 @@ yield this.app.mysql.insert(table, {

=> INSERT INTO `$table`(`id`, `fullname`) VALUES(123, CONCAT("James", "Bond"))
```

[egg-mysql]: https://github.com/eggjs/egg-mysql

0 comments on commit 234ceac

Please sign in to comment.