File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ Mysql2::Client - your connection to the database
15
15
Mysql2::Result - returned from issuing a #query on the connection. It includes Enumerable.
16
16
17
17
## Installing
18
-
18
+ ### OSX / Linux
19
19
``` sh
20
20
gem install mysql2
21
21
```
@@ -24,6 +24,26 @@ This gem links against MySQL's `libmysqlclient` C shared library. You may need t
24
24
25
25
If you have installed MySQL to a non-standard location, add ` gem install mysql2 --with-mysql-config=/some/random/path/bin/mysql_config `
26
26
27
+ ### Windows
28
+ First, make sure you have the DevKit installed (http://rubyinstaller.org/downloads/ ) and its variables
29
+ are loaded by running devkit\devktvars.bat .
30
+
31
+ Next, you need a MySQL library to link against. If you have MySQL loaded on your development machine,
32
+ you can use that. If not, you will need to either copy the MySQL directory from your server, or else
33
+ obtain a copy of the MySQL C connector: http://dev.mysql.com/downloads/connector/c/
34
+
35
+ If you're using the connector, I recommend just getting the .zip file and unzipping it someplace convenient.
36
+
37
+ Now you can install mysql2. You must use the ` --with-mysql-dir ` option to tell gem where your MySQL library
38
+ files are. For example, if you unzipped the connector to c:\mysql-connector-c-6.1.1-win32 you would install
39
+ the gem like this:
40
+
41
+ gem install mysql2 -- --with-mysql-dir=c:\mysql-connector-c-6.1.1-win32
42
+
43
+ Finally, you must copy libmysql.dll from the lib subdirectory of your MySQL or MySQL connector directory into
44
+ your ruby\bin directory. In the above example, libmysql.dll would be located at
45
+ c:\mysql-connector-c-6.1.1-win32\lib .
46
+
27
47
## Usage
28
48
29
49
Connect to a database:
You can’t perform that action at this time.
0 commit comments