MySQL's JDBC connector has a security feature called allowMultiQueries, which defaults to false. When turned off, it prevents using a useful, but potentially dangerous feature in MySQL via JDBC: try (Statement s = connection.createStatement()) { try { s.execute("create table t (i int);"); // This doesn't work, by default: s.executeUpdate(""" insert into t values (1); insert … Continue reading MySQL’s allowMultiQueries flag with JDBC and jOOQ →
The latest from the MySQL community
Ideas, releases, practical guides, and perspectives from the people building with MySQL.
I made some improvements to the 'proxy' inside of MySQL 5.7 that
I've created for WarpSQL (Shard-Query 3). I've made the
MySQL proxy/shim pluggable and I moved the SQLClient to
sql/sql_client.cc. I've merged these changes into 'master'
in my fork.
Now you can create "SQL shim" plugins (SHOW PASSWORD is
implemented in plugin/sql_shim) and install them in the server
like regular plugins:
-- command doesn't work mysql> show password; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'password' at line 1 -- install the example sql_shim plugin: mysql> install plugin sql_shim soname 'sql_shim.so'; Query OK, 0 rows affected (0.00 sec) -- now the command works mysql> show password; +--+ | | +--+ | | +--+ 1 row in set (0.00 sec)
…
I made some improvements to the 'proxy' inside of MySQL 5.7 that
I've created for WarpSQL (Shard-Query 3). I've made the
MySQL proxy/shim pluggable and I moved the SQLClient to
sql/sql_client.cc. I've merged these changes into 'master'
in my fork.
Now you can create "SQL shim" plugins (SHOW PASSWORD is
implemented in plugin/sql_shim) and install them in the server
like regular plugins:
-- command doesn't work mysql> show password; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'password' at line 1 -- install the example sql_shim plugin: mysql> install plugin sql_shim soname 'sql_shim.so'; Query OK, 0 rows affected (0.00 sec) -- now the command works mysql> show password; +--+ | | +--+ | | +--+ 1 row in set (0.00 sec)
…
[this is a repost of my http://shardquery.com blog post, because it did
not syndicate to planet.mysql.com]
As work on WarpSQL (Shard-Query 3) progresses, it has outgrown MySQL proxy. MySQL proxy is a very useful tool, but it requires LUA scripting, and it is an external daemon that needs to be maintained. The MySQL proxy module for Shard-Query works well, but to make WarpSQL into a real distributed transaction coordinator, moving the proxy logic inside of the server makes more sense.
The main benefit of MySQL proxy is that it allows a script to "inject" queries between the client and server, intercepting the results and possibly sending back new results to the client. I would like similar functionality, but inside of the server.
For example, I would like to implement new SHOW commands, and these commands do not need to be …
[Read more]
[this is a repost of my http://shardquery.com blog post, because it did
not syndicate to planet.mysql.com]
As work on WarpSQL (Shard-Query 3) progresses, it has outgrown MySQL proxy. MySQL proxy is a very useful tool, but it requires LUA scripting, and it is an external daemon that needs to be maintained. The MySQL proxy module for Shard-Query works well, but to make WarpSQL into a real distributed transaction coordinator, moving the proxy logic inside of the server makes more sense.
The main benefit of MySQL proxy is that it allows a script to "inject" queries between the client and server, intercepting the results and possibly sending back new results to the client. I would like similar functionality, but inside of the server.
For example, I would like to implement new SHOW commands, and these commands do not need to be …
[Read more]Two easy ways to prevent SQL Injection in PHP
To many people still execute sql queries using methods which does not prevent SQL Injection, and many tutorials out there give bad example of doing so.
SQL Injection? What? -> SQL Injection explained
There are two easy aproachs to prevent SQL Injection:
- Using PDO:
stmt = $pdo->prepare('SELECT * FROM employees WHERE name = :name'); $stmt->execute(array(':name' => $name)); foreach ($stmt as $row) { // do something with $row } - Using mysqli:
$stmt = $dbConnection->prepare('SELECT * FROM employees WHERE name = ?'); $stmt->bind_param('s', $name); $stmt>execute(); $result = …
Transparently encrypted storage of *any* kind (storage engine
based data encryption, truecrypt volume encryption, bitkeeper,
etc) is *just as insecure* to most types of attack as
non-encrypted data. SQL injection or security escalation
vulnerabilities, operating system vulnerabilities and cross site
scripting attacks could give attackers access to the database
data. It doesn't matter if you encrypt the database's
physical storage in the database itself (in the storage engine
layer) or on disk (at the filesystem level) since either way the
data is presented unencrypted through the SQL
interface.
Transparent encryption is great for protecting your laptop data
from theft by stealing your laptop. It is very unlikely
someone will attack your server by stealing it.
It doesn't protect you from a malicious SQL injection which drops
all your tables or reads all your data.
If you are …
Transparently encrypted storage of *any* kind (storage engine
based data encryption, truecrypt volume encryption, bitkeeper,
etc) is *just as insecure* to most types of attack as
non-encrypted data. SQL injection or security escalation
vulnerabilities, operating system vulnerabilities and cross site
scripting attacks could give attackers access to the database
data. It doesn't matter if you encrypt the database's
physical storage in the database itself (in the storage engine
layer) or on disk (at the filesystem level) since either way the
data is presented unencrypted through the SQL
interface.
Transparent encryption is great for protecting your laptop data
from theft by stealing your laptop. It is very unlikely
someone will attack your server by stealing it.
It doesn't protect you from a malicious SQL injection which drops
all your tables or reads all your data.
If you are …
Last Friday the Dutch TV program Zembla aired part two of the "verzuimpolitie" series.
The first part was mainly about how employers
could access medical information about employees. There is a news
article about the second part here (with google translate).
…
In the past few years, hackers, hacktivists and criminals have targeted millions of databases. Any information you own is at risk.
Join GreenSQL’s live webinar and learn the actions required in order to protect your invaluable information and that of your customers.
Security expert David Maman, Founder and CTO of GreenSQL, the Unified Database Security Company, will cover the following topics:
- Advanced database hacking methods
- Common database security threats
- How to protect databases from SQL injection attacks
- Separation of …
[Read more]