MySQL licensing and GPL [closed]

2019-01-11 16:56发布

问题:

As far as I know, when I build a desktop/server app using any GPL code like MySQL I will have to release the source code of my software under the GPL.

If I want to develop a web-app using MySQL, my code will link against the MySQL libraries. Must I release the sourcecode of my webapp in this situation to be in accordance with the GPL?

回答1:

Provided that you keep it server-only(and therefore "private"), you don't have to release it as GPL. But as soon as it reaches public desktops, it can no longer be considered an internal build, and therefore source code is needed.

So you can:

  • Release your code as GPL
  • Buy the commercial version of MySQL
  • Keep it server-only.


回答2:

You must either release the source (under GPL), or pay for a proprietary license to MySQL so that you gain the right to distribute the MySQL binaries under a license that is more amenable to that which proprietary products use. It's best to take this type of question to your lawyer, though.

ETA: Just to clarify a little bit; if you write your own library which talks to MySQL using its wire-line protocol, then you'll always be 100% in the clear. Likewise, if you use a library that has done just that, but is BSD licensed (as an example), then you'd also be in the clear, because you're only talking to MySQL over a socket connection, and not actually calling into GPL'd code. I am not immediately aware of any BSD licensed interfaces to the MySQL protocol, but it's certainly possible that there is one out there somewhere.



回答3:

If you're running the web application yourself, and not distributing it as an application, then you don't have to release the source. Allowing access to a web application is not considered distribution.

Edit: if interested you might look at the Affero General Public License, which requires that source be made available to network users of AGPL software (e.g. it would apply to web applications).



回答4:

You don't necessarily have to link against MySQL libraries in order to use MySQL in your application. All you have to do is to "speak" to a MySQL server using the MySQL protocol; in which case, you are connecting to the MySQL server as a client, i.e. as a user, and then you don't need to release your software under the GNU GPL license.

The question is, how can your program speak the MySQL protocol? One possibility is using the official MySQL client library (connector), which is GPL'd. If you do this, you are statically linking your program to a GPL'd library, and thus you need to release your software under the GPL.

Alternatively, you can link against a third party client library, with a different license. For example you can use the MariaDB Client Library, which is LGPL'd (and is thus compatible with proprietary software) and provides the same API of the original MySQL client library. See the MariaDB licensing FAQ, which also applies to MySQL, for more details and advice.

It may be tricky to distribute the MySQL server along with your software: you could simply require your customers to download and install MySQL by their own, or develop a simple downloader to be distributed with your software.



回答5:

MySQL uses dual licensing. As they put it - if you're free, we're free.

So, if you use, as far as I know, MySQL JDBC Connector only - you should have license or GPL your code.



回答6:

Unless you derive from and/or distribute the GPL'd software, you should be safe.

Linking against the MySQL client library is neither a derivative work, nor distribution.

UPDATE: Come to think about it, how you link (dynamic or static) against the libraries will make a difference. Static linking is distribution, but if you link dynamically and your clients download the connectors themselves, that's not distribution and you should be safe.

Oh, and IANAL.



回答7:

If I want to develop a web-app using MySQL, my code will link against the MySQL libraries. Should I release the sourcecode of my webapp in this situation to be in accordance with the GPL?

  1. As others have said, if you're not distributing the app to others there is no issue at all.

  2. Normally, you would develop against a standard database API and let the user decide what database to connect to the app. In this case there is no issue. “Your code” wouldn't be linking to libmysqlclient, but it could potentially be combined with a database access module that does link to libmysqlclient.

  3. If you want to distribute an installer that sets up your application and libmysqlclient together, that probably wouldn't count as “mere aggregation”, so it would require you to distribute your app under an open source licence. This needn't, however, necessarily be GPL — see the MySQL FOSS License Exception.

  4. If you want to distribute an installer that sets up your application and the MySQL server itself, the Exception does not apply, so you are limited to GPL only.

Naturally IANAL, and there is certainly still some uncertainty about what counts as derivation especially with regard to dynamic linking. However the above is my understanding of MySQL AB's traditional position on licensing, and I've not heard of any change post-Sun-takeover.



回答8:

Unfortunately, it is not nearly so clean cut: The GPL prohibits distribution without giving the source of every "derived product". Distribution is legally defined as the act of transferring source from one computer to one or more computers for official use.

Unfortunately, that can also include use on server clusters, QA boxes, dev boxes, etc. In the modern dev shop, just releasing the code to multiple frontend/backend boxes is technically distribution (in the eyes of the law).

It doesn't matter what the Free Software Foundation thinks, it matters what a few judges think once someone/a corporation is sued for doing exactly that.

That's just one more reason why the GPL's primary customers these days are corporations who wish to keep competitors from forking their code. Everyone else should consider far less encumbering licenses like the MIT or Creative Commons Attribution licenses.



回答9:

First, I am not a lawyer. Talk with one before taking any advice here.

Beyond that, if you do not distribute your web app, you likely do not need to release your changes. You can still make your web app available to be used by others if you host the web app.



回答10:

If your distribution includes and installs MySql in the same package, it requires a commercial license.

But if you only distribute your code, with a mere "requires MySql" notice and an installation script (to create/populate the tables), there should be no problem, AFAIK.

IANAL, of course.