views:

254

answers:

6

I want to know which database is more secure: mysql or pgSQL.

Which ones support stored procedures?

What are the advantages of one over the other?

+4  A: 

Neither is "more secure". The database software is only as secure as you make it. If your application is poorly written, neither one will be secure, and vice-versa.

Both databases support stored procedures. (MySQL, PostgreSQL)

As for pros and cons of each, see this question.

musicfreak
A default PostgreSQL is easier to exploit than a default MySQL because PostgreSQL allows for query stacking.
Rook
@The Rook: You shouldn't use the default configuration of any database in a production environment. But either way, it would be *your* code that makes the database less secure, not the database itself.
musicfreak
@musicfreak Security is about planning on failure. Thats why passwords are hashed, so that they cannot be used until they are broken. MySQL is more secure than PostgreSQL.
Rook
+1  A: 

Security is an aspect of your application code and deployment scenario.

Even the "securest DB of the world" will fail to protect you when you:

  • Store user passwords in the DB in clear text
  • Use a root account with password "root"
  • Allow remote connections to the DB (although it's only user, your application, connects from localhost)

etc

cherouvim
A: 

No there is no security difference. Which database you choose will not impact the security of your application, it really depends whether it's built correctly or not.

Your database servers won't be on a public network anyway, will they? If so, it doesn't really matter - only people who can get into your VPN can access them.

The passwords for the database are normally held in the clear in files on your application servers. This is not a security risk if done correctly.

MarkR
A: 

Stored Procedure in PostgreSQL

Technofreak
A: 

Stored Procedure in MySQL

And as far as security is concerned, well it is mostly in your hands than in MySQL or Postgres.

Technofreak
+3  A: 

PostgreSQL supports some more security features than mysql, for example integration with GSSAPI or Kerberos for logins (last I checked, mysql didn't have these).

Traditionally, PostgreSQL has had fewer security issues than MySQL, but they are both doing very well on that.

In the end, your security is much more likely to depend on how you use the database, and not which database you use.

Both have Stored Procedures these days, but PostgreSQL has much more flexible so far (for example, support for stored procedures in perl, python, tcl, R etc)

Magnus Hagander