2

I have looked all over and can't find clear answers to the following:

  1. If I write code in PHP or Python that uses GPL MySQL connectors for PHP or Python - which license applies to my code? That of PHP or Python, or GPL?
  2. Can I run my PHP or Python code on a server and offer commercial services without the GPL?
  3. Can I bundle my PHP code in an application and distribute it commercially without the GPL?

1 Answer 1

3
  1. If I write code in PHP or Python that uses GPL MySQL connectors for PHP or Python - which license applies to my code? That of PHP or Python, or GPL?

If my code is released (in source) using one of the of FOSS licenses listed in the MySQL Exception then that license applies. Otherwise the GPL would apply.

  1. Can I run my PHP or Python code on a server and offer commercial services without the GPL?

Yes, as long as I run my code is a service: for instance Facebook and Google are known to use MySQL on the backend of some of their commercial services.

  1. Can I bundle my PHP code in an application and distribute it commercially without the GPL?

I can, but then my PHP (or Python) code would be subject to the GPL when it depends at runtime on MySQL. This is the quid-pro-quo to entice you to buy a commercial license. As a side note, if I ever buy a commercial license of MySQL for redistribution, the terms (last I saw them) did prohibit to mix the commercial MySQL with the open source GPL-licensed MySQL, and these are different binaries anyway.

Let's say there is a wrapper for MySQL connector in Python that has been released under Python license (as is allowed by the FOSS exception) - and my code uses this wrapper. Am I not bound by the Python license instead of GPL?

At rest, my source code does not interact nor embed with anything and is not subject to the GPL.

But at runtime, this Python connector is unlikely to have implemented the raw wire protocol for MySQL and likely links with the MySQL GPL-licensed headers and libraries (at least all the Python drivers I know of do): therefore at runtime, I consider that the GPL terms would extend to the Python driver and from there to my application. See this article for a gentle introduction on dependencies.

That said what can I do in this case?

  1. Do not use MySQL and use PostgreSQL, SQLite, etc. This is what I do. Personally I also find PostgreSQL to be a superior technical choice in most cases.

  2. Consider alternative MySQL "implementations" such as MariaDB. MariaDB has furthered the old MySQL LGPL-licensed drivers to bring them up to date with the latest protocol. There used to be also a BSD or MIT-licensed driver called libdrizzle, but I am less clear about its status.

Using the MariaDB driver would replace my proprietary->GPL interaction by a proprietary->LGPL dynamic linking interaction which I and my lawyers may consider OK, though this is a grey area because of the lawsuit-happy Oracle commercial interests being bypassed in this context.

1
  • Thanks. I am accepting your answer. One followup on 3 though. Let's say there is a wrapper for MySQL connector in Python that has been released under Python license (as is allowed by the FOSS exception) - and my code uses this wrapper. Am I not bound by the Python license instead of GPL?
    – Ziffusion
    Commented Sep 27, 2016 at 20:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.