Skip to content

Commit 624409d

Browse files
qudongfangsodabrew
authored andcommitted
Debian 9 released with MariaDB as the only MySQL variant since 2017 (#1038)
1 parent 98304cb commit 624409d

File tree

2 files changed

+30
-26
lines changed

2 files changed

+30
-26
lines changed

README.md

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,18 @@ The API consists of three classes:
1818
`Mysql2::Statement` - returned from issuing a #prepare on the connection. Execute the statement to get a Result.
1919

2020
## Installing
21+
2122
### General Instructions
23+
2224
``` sh
2325
gem install mysql2
2426
```
2527

2628
This gem links against MySQL's `libmysqlclient` library or `Connector/C`
2729
library, and compatible alternatives such as MariaDB.
28-
You may need to install a package such as `libmysqlclient-dev`, `mysql-devel`,
29-
or other appropriate package for your system. See below for system-specific
30-
instructions.
30+
You may need to install a package such as `libmariadb-dev`, `libmysqlclient-dev`,
31+
`mysql-devel`, or other appropriate package for your system. See below for
32+
system-specific instructions.
3133

3234
By default, the mysql2 gem will try to find a copy of MySQL in this order:
3335

@@ -74,8 +76,8 @@ To see line numbers in backtraces, declare these environment variables
7476

7577
### Linux and other Unixes
7678

77-
You may need to install a package such as `libmysqlclient-dev`, `mysql-devel`,
78-
or `default-libmysqlclient-dev`; refer to your distribution's package guide to
79+
You may need to install a package such as `libmariadb-dev`, `libmysqlclient-dev`,
80+
`mysql-devel`, or `default-libmysqlclient-dev`; refer to your distribution's package guide to
7981
find the particular package. The most common issue we see is a user who has
8082
the library file `libmysqlclient.so` but is missing the header file `mysql.h`
8183
-- double check that you have the _-dev_ packages installed.
@@ -90,6 +92,7 @@ If you have not done so already, you will need to install the XCode select tools
9092
`xcode-select --install`.
9193

9294
### Windows
95+
9396
Make sure that you have Ruby and the DevKit compilers installed. We recommend
9497
the [Ruby Installer](http://rubyinstaller.org) distribution.
9598

@@ -180,7 +183,7 @@ question marks in the statement. Query options can be passed as keyword argument
180183
to the execute method.
181184

182185
Be sure to read about the known limitations of prepared statements at
183-
https://dev.mysql.com/doc/refman/5.6/en/c-api-prepared-statement-problems.html
186+
[https://dev.mysql.com/doc/refman/5.6/en/c-api-prepared-statement-problems.html](https://dev.mysql.com/doc/refman/5.6/en/c-api-prepared-statement-problems.html)
184187

185188
``` ruby
186189
statement = @client.prepare("SELECT * FROM users WHERE login_count = ?")
@@ -348,7 +351,8 @@ end
348351
```
349352

350353
Yields:
351-
```
354+
355+
```ruby
352356
{"1"=>1}
353357
{"2"=>2}
354358
next_result: Unknown column 'A' in 'field list' (Mysql2::Error)
@@ -507,7 +511,7 @@ There are a few things that need to be kept in mind while using streaming:
507511
* `:cache_rows` is ignored currently. (if you want to use `:cache_rows` you probably don't want to be using `:stream`)
508512
* You must fetch all rows in the result set of your query before you can make new queries. (i.e. with `Mysql2::Result#each`)
509513

510-
Read more about the consequences of using `mysql_use_result` (what streaming is implemented with) here: http://dev.mysql.com/doc/refman/5.0/en/mysql-use-result.html.
514+
Read more about the consequences of using `mysql_use_result` (what streaming is implemented with) here: [http://dev.mysql.com/doc/refman/5.0/en/mysql-use-result.html](http://dev.mysql.com/doc/refman/5.0/en/mysql-use-result.html).
511515

512516
### Lazy Everything
513517

@@ -528,21 +532,21 @@ As for field values themselves, I'm workin on it - but expect that soon.
528532

529533
This gem is tested with the following Ruby versions on Linux and Mac OS X:
530534

531-
* Ruby MRI 2.0.0, 2.1.x, 2.2.x, 2.3.x, 2.4.x, 2.5.x, 2.6.x
532-
* Rubinius 2.x and 3.x do work but may fail under some workloads
535+
* Ruby MRI 2.0.0, 2.1.x, 2.2.x, 2.3.x, 2.4.x, 2.5.x, 2.6.x
536+
* Rubinius 2.x and 3.x do work but may fail under some workloads
533537

534538
This gem is tested with the following MySQL and MariaDB versions:
535539

536-
* MySQL 5.5, 5.6, 5.7, 8.0
537-
* MySQL Connector/C 6.0 and 6.1 (primarily on Windows)
538-
* MariaDB 5.5, 10.0, 10.1, 10.2, 10.3
540+
* MySQL 5.5, 5.6, 5.7, 8.0
541+
* MySQL Connector/C 6.0 and 6.1 (primarily on Windows)
542+
* MariaDB 5.5, 10.0, 10.1, 10.2, 10.3
539543

540544
### Ruby on Rails / Active Record
541545

542-
* mysql2 0.5.x works with Rails / Active Record 5.0.7, 5.1.6, and higher.
543-
* mysql2 0.4.x works with Rails / Active Record 4.2.5 - 5.0 and higher.
544-
* mysql2 0.3.x works with Rails / Active Record 3.1, 3.2, 4.x, 5.0.
545-
* mysql2 0.2.x works with Rails / Active Record 2.3 - 3.0.
546+
* mysql2 0.5.x works with Rails / Active Record 5.0.7, 5.1.6, and higher.
547+
* mysql2 0.4.x works with Rails / Active Record 4.2.5 - 5.0 and higher.
548+
* mysql2 0.3.x works with Rails / Active Record 3.1, 3.2, 4.x, 5.0.
549+
* mysql2 0.2.x works with Rails / Active Record 2.3 - 3.0.
546550

547551
### Asynchronous Active Record
548552

@@ -625,11 +629,11 @@ though.
625629
## Special Thanks
626630

627631
* Eric Wong - for the contribution (and the informative explanations) of some thread-safety, non-blocking I/O and cleanup patches. You rock dude
628-
* Yury Korolev (http://github.com/yury) - for TONS of help testing the Active Record adapter
629-
* Aaron Patterson (http://github.com/tenderlove) - tons of contributions, suggestions and general badassness
630-
* Mike Perham (http://github.com/mperham) - Async Active Record adapter (uses Fibers and EventMachine)
631-
* Aaron Stone (http://github.com/sodabrew) - additional client settings, local files, microsecond time, maintenance support
632-
* Kouhei Ueno (https://github.com/nyaxt) - for the original work on Prepared Statements way back in 2012
633-
* John Cant (http://github.com/johncant) - polishing and updating Prepared Statements support
634-
* Justin Case (http://github.com/justincase) - polishing and updating Prepared Statements support and getting it merged
635-
* Tamir Duberstein (http://github.com/tamird) - for help with timeouts and all around updates and cleanups
632+
* [Yury Korolev](http://github.com/yury) - for TONS of help testing the Active Record adapter
633+
* [Aaron Patterson](http://github.com/tenderlove) - tons of contributions, suggestions and general badassness
634+
* [Mike Perham](http://github.com/mperham) - Async Active Record adapter (uses Fibers and EventMachine)
635+
* [Aaron Stone](http://github.com/sodabrew) - additional client settings, local files, microsecond time, maintenance support
636+
* [Kouhei Ueno](https://github.com/nyaxt) - for the original work on Prepared Statements way back in 2012
637+
* [John Cant](http://github.com/johncant) - polishing and updating Prepared Statements support
638+
* [Justin Case](http://github.com/justincase) - polishing and updating Prepared Statements support and getting it merged
639+
* [Tamir Duberstein](http://github.com/tamird) - for help with timeouts and all around updates and cleanups

ext/mysql2/extconf.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def asplode(lib)
77
elsif RUBY_PLATFORM =~ /darwin/
88
abort "-----\n#{lib} is missing. You may need to 'brew install mysql' or 'port install mysql', and try again.\n-----"
99
else
10-
abort "-----\n#{lib} is missing. You may need to 'apt-get install libmysqlclient-dev' or 'yum install mysql-devel', and try again.\n-----"
10+
abort "-----\n#{lib} is missing. You may need to 'sudo apt-get install libmariadb-dev', 'sudo apt-get install libmysqlclient-dev' or 'sudo yum install mysql-devel', and try again.\n-----"
1111
end
1212
end
1313

0 commit comments

Comments
 (0)