浏览代码

Closes #220: switch to PyMySQL driver

Adrien Panay 8 年前
父节点
当前提交
01b38e97e9
共有 3 个文件被更改,包括 19 次插入12 次删除
  1. 11 8
      README.md
  2. 2 1
      tracim/development.ini.base
  3. 6 3
      tracim/test.ini

+ 11 - 8
README.md 查看文件

138
 
138
 
139
 Or if you want to use MySQL as database engine
139
 Or if you want to use MySQL as database engine
140
 
140
 
141
-    apt-get install mysql-server mysql-client libmysqlclient-dev
141
+    apt-get install mysql-server
142
 
142
 
143
 Or if you want to use SQLite as database engine
143
 Or if you want to use SQLite as database engine
144
 
144
 
178
     cd tracim && python setup.py develop && cd -
178
     cd tracim && python setup.py develop && cd -
179
     pip install -r install/requirements.txt
179
     pip install -r install/requirements.txt
180
 
180
 
181
-**Note**: If you want to use MySQL database, please refer to Configuration/database schema note to install required package.
182
-
183
 ## Database Setup ##
181
 ## Database Setup ##
184
 
182
 
185
 ### Minimalist introduction to PostgreSQL ###
183
 ### Minimalist introduction to PostgreSQL ###
257
 
255
 
258
 ### Minimalist introduction to MySQL ###
256
 ### Minimalist introduction to MySQL ###
259
 
257
 
260
-## Create database ##
258
+#### Driver ####
259
+
260
+Tracim uses the PyMySQL driver between the SQLAlchemy ORM and the MySQL RDBMS.
261
+The only requirement is a pip installable package:
262
+
263
+    pip install PyMySQL
264
+
265
+#### Create database ####
261
 
266
 
262
 Connect to mysql with root user (password has been set at "Installation" -> "Dependencies" chapter, when installing package)
267
 Connect to mysql with root user (password has been set at "Installation" -> "Dependencies" chapter, when installing package)
263
 
268
 
304
 
309
 
305
     sqlalchemy.url = postgresql://tracimuser:tracimpassword@127.0.0.1:5432/tracimdb?client_encoding=utf8
310
     sqlalchemy.url = postgresql://tracimuser:tracimpassword@127.0.0.1:5432/tracimdb?client_encoding=utf8
306
 
311
 
307
-There is an example value for MySQL below (please refer to Configuration/database schema note to install required package):
312
+There is an example value for MySQL below:
308
 
313
 
309
-    sqlalchemy.url = mysql+oursql://tracimuser:tracimpassword@127.0.0.1/tracimdb
314
+    sqlalchemy.url = mysql+pymysql://tracimuser:tracimpassword@127.0.0.1/tracimdb
310
 
315
 
311
 There is an example value for SQLite below :
316
 There is an example value for SQLite below :
312
 
317
 
421
 
426
 
422
 The last step before to run the application is to initialize the database schema. This is done through the following command:
427
 The last step before to run the application is to initialize the database schema. This is done through the following command:
423
 
428
 
424
-**Note**: If you want to use MySQL database, please install this pip package: ```pip install https://launchpad.net/oursql/py3k/py3k-0.9.4/+download/oursql-0.9.4.zip```
425
-
426
     cd tracim && gearbox setup-app && cd -
429
     cd tracim && gearbox setup-app && cd -
427
 
430
 
428
 ## Running the server ##
431
 ## Running the server ##

+ 2 - 1
tracim/development.ini.base 查看文件

94
 # invalidate the URI when specifying a SQLite db via path name
94
 # invalidate the URI when specifying a SQLite db via path name
95
 # sqlalchemy.url=postgresql://username:password@hostname:port/databasename
95
 # sqlalchemy.url=postgresql://username:password@hostname:port/databasename
96
 # sqlalchemy.url=mysql://username:password@hostname:port/databasename
96
 # sqlalchemy.url=mysql://username:password@hostname:port/databasename
97
-# sqlalchemy.url = postgresql://tracim_user:tracim_user_password@127.0.0.1:5432/tracim?client_encoding=utf8
97
+# sqlalchemy.url = postgresql://tracimuser:tracimpassword@127.0.0.1:5432/tracimdb?client_encoding=utf8
98
+# sqlalchemy.url = mysql+pymysql://tracimuser:tracimpassword@127.0.0.1/tracimdb
98
 sqlalchemy.url = <replace_database_uri_here>
99
 sqlalchemy.url = <replace_database_uri_here>
99
 
100
 
100
 #echo shouldn't be used together with the logging module.
101
 #echo shouldn't be used together with the logging module.

+ 6 - 3
tracim/test.ini 查看文件

22
 port = 8080
22
 port = 8080
23
 
23
 
24
 [app:main]
24
 [app:main]
25
-sqlalchemy.url =  postgresql://postgres:dummy@127.0.0.1:5432/tracim_test?client_encoding=utf8
25
+sqlalchemy.url = postgresql://tracimuser:tracimpassword@127.0.0.1:5432/tracimdb_test?client_encoding=utf8
26
+# sqlalchemy.url = mysql+pymysql://tracimuser:tracimpassword@127.0.0.1/tracimdb_test
26
 use = config:development.ini
27
 use = config:development.ini
27
 
28
 
28
 [app:main_without_authn]
29
 [app:main_without_authn]
30
 skip_authentication = True
31
 skip_authentication = True
31
 
32
 
32
 [app:ldap]
33
 [app:ldap]
33
-sqlalchemy.url =  postgresql://postgres:dummy@127.0.0.1:5432/tracim_test?client_encoding=utf8
34
+sqlalchemy.url = postgresql://tracimuser:tracimpassword@127.0.0.1:5432/tracimdb_test?client_encoding=utf8
35
+# sqlalchemy.url = mysql+pymysql://tracimuser:tracimpassword@127.0.0.1/tracimdb_test
34
 auth_type = ldap
36
 auth_type = ldap
35
 ldap_url = ldap://localhost:3333
37
 ldap_url = ldap://localhost:3333
36
 ldap_base_dn = dc=directory,dc=fsf,dc=org
38
 ldap_base_dn = dc=directory,dc=fsf,dc=org
49
 use = config:development.ini
51
 use = config:development.ini
50
 
52
 
51
 [app:radicale]
53
 [app:radicale]
52
-sqlalchemy.url =  postgresql://postgres:dummy@127.0.0.1:5432/tracim_test?client_encoding=utf8
54
+sqlalchemy.url = postgresql://tracimuser:tracimpassword@127.0.0.1:5432/tracimdb_test?client_encoding=utf8
55
+# sqlalchemy.url = mysql+pymysql://tracimuser:tracimpassword@127.0.0.1/tracimdb_test
53
 
56
 
54
 use = config:development.ini
57
 use = config:development.ini
55
 
58