Explorar el Código

Closes #220: switch to PyMySQL driver

Adrien Panay hace 7 años
padre
commit
01b38e97e9
Se han modificado 3 ficheros con 19 adiciones y 12 borrados
  1. 11 8
      README.md
  2. 2 1
      tracim/development.ini.base
  3. 6 3
      tracim/test.ini

+ 11 - 8
README.md Ver fichero

@@ -138,7 +138,7 @@ If you want use PostgreSQL as database engine:
138 138
 
139 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 143
 Or if you want to use SQLite as database engine
144 144
 
@@ -178,8 +178,6 @@ To install tracim and it's dependencies:
178 178
     cd tracim && python setup.py develop && cd -
179 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 181
 ## Database Setup ##
184 182
 
185 183
 ### Minimalist introduction to PostgreSQL ###
@@ -257,7 +255,14 @@ In this case, delete the user and database you previously created (using pgtool)
257 255
 
258 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 267
 Connect to mysql with root user (password has been set at "Installation" -> "Dependencies" chapter, when installing package)
263 268
 
@@ -304,9 +309,9 @@ Configure database in the development.ini file. This is defined as sqlalchemy.ur
304 309
 
305 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 316
 There is an example value for SQLite below :
312 317
 
@@ -421,8 +426,6 @@ or
421 426
 
422 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 429
     cd tracim && gearbox setup-app && cd -
427 430
 
428 431
 ## Running the server ##

+ 2 - 1
tracim/development.ini.base Ver fichero

@@ -94,7 +94,8 @@ beaker.session.validate_key = 3283411b-1904-4554-b0e1-883863b53080
94 94
 # invalidate the URI when specifying a SQLite db via path name
95 95
 # sqlalchemy.url=postgresql://username:password@hostname:port/databasename
96 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 99
 sqlalchemy.url = <replace_database_uri_here>
99 100
 
100 101
 #echo shouldn't be used together with the logging module.

+ 6 - 3
tracim/test.ini Ver fichero

@@ -22,7 +22,8 @@ host = 127.0.0.1
22 22
 port = 8080
23 23
 
24 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 27
 use = config:development.ini
27 28
 
28 29
 [app:main_without_authn]
@@ -30,7 +31,8 @@ use = main
30 31
 skip_authentication = True
31 32
 
32 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 36
 auth_type = ldap
35 37
 ldap_url = ldap://localhost:3333
36 38
 ldap_base_dn = dc=directory,dc=fsf,dc=org
@@ -49,7 +51,8 @@ resetpassword.smtp_passwd =  fake
49 51
 use = config:development.ini
50 52
 
51 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 57
 use = config:development.ini
55 58