252604 cazuri COVID-19 în Moldova
3466 – cazuri active
243195 – cazuri vindecate
5943 – cazuri fatale
Actualizarea datelor: 9 mai 2021 ora 07:20


Secure existing MySQL installation

secure-mysql-installation
MySQL is a free, easy-to-use database server that supports multiple databases and tables, and allows clients to query them with SQL. This cheat-sheet shows how to secure MySQL in a few simple steps.

Change MySQL root password

First step to secure MySQL is changing the database superuser password, which is empty by default:

mysql> UPDATE mysql.user SET Password=PASSWORD('pa$$w0rD') WHERE User='root'; Remove unneeded databases and users

Next, remove test database:

mysql> DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'; mysql> DROP DATABASE test;

and users:

mysql> DELETE FROM mysql.user WHERE User='root' AND Host != 'localhost'; mysql> DELETE FROM mysql.user WHERE user = '';

Finally, reload MySQL privilege information to make above changes to take effect:

mysql> FLUSH PRIVILEGES; Improve local security

MySQL config file contains several directives that can help to avoid some types of attacks. Open it and change the following values in [mysqld] section:

bind-address=127.0.0.1 local-infile=0 # avoid some Denial of Service attacks max_user_connections=256 max_connect_error=4

bind-address
Make MySQL to listen for TCP/IP connections only locally on the loop-back interface.

local-infile
Prevents against unauthorized reading from local files, useful to avoid SQL injection attacks.

max_user_connections
The maximum number of simultaneous connections allowed for a single user

max_connect_error
Block a host after this many unsuccessful connection attempts. This is especially helpful against a dictionary-based password attack. You can unblock blocked hosts with the FLUSH HOSTS statement.

Install a database firewall

GreenSQL is an Open Source database firewall used to protect databases from SQL injection attacks. It works as a proxy and has built-in support for MySQL. The logic is based on evaluation of SQL commands using a risk scoring matrix as well as blocking known db administrative commands (DROP, CREATE, etc). GreenSQL provides MySQL database security solution

Related Posts:

Sursa
2009-12-17 16:13:28



Comenteaza





Ultimele 25 posturi adăugate

16:14:01România donează gratuit încă 100 800 de doze de vaccin anti-covid R. Moldova —» Elena Robu
10:12:00Ambulanţa Cotcodac a fost oprită de poliţie —» Curaj.TV | Media alternativă
09:58:38Maia Sandu s-a vaccinat contra Covid-19 cu AstraZeneca —» Elena Robu
08:52:38„Pe Contrasens„ – cartea care poate fi recomandată cititorilor cu toată încrederea —» Blog de biblioteconomie şi ştiinţa informării
08:22:00Pui transportaţi şi vînduţi în condiţii inadecvate —» Curaj.TV | Media alternativă
08:07:14Activistul atacat de suita primarului, a aşteptat aproape 7 ore să vină ambulanţa —» Curaj.TV | Media alternativă
07:00:19Dacă Hristos nu ar fi înviat —» Moldova Creștină
18:25:19Poliția taie frunze la ciini în fața zebrei la Ciocana —» Curaj.TV | Media alternativă
18:16:57Despre Renato, Maia, Rizea și alte personaje politice noi sau mai vechi —» Curaj.TV | Media alternativă
14:20:00Poeme de Mabel Antonini (trad. în română*) —» Andrei LANGA. Blogul personal
13:27:58Mărăciniș" —» Andrei LANGA. Blogul personal
12:14:52Modalități de interpretare a dramaturgiei în monografia Anei Ghilaș: de la supraeu la „discursul teatral” —» Biblioteca de Arte 'Tudor Arghezi'
09:30:28Săniuș* —» Andrei LANGA. Blogul personal
07:17:14Vocea Diasporei: M-am înregistrat prealabil pentru alegerile parlamentare anticipate din 11 iulie 2021 —» Elena Robu
07:00:08Lidia Căldăraru – Krînițcaia (1906 – 1978) —» Moldova Creștină
18:10:32Gențile împletite: moda primăvară-vară 2021 —» Millavintage
15:13:00A dose of military satire —» Dragostina Vicol – jurnalism militar
15:04:57Кишинёвский аэропорт —» Benia pictures production
15:04:57Компьютерное кресло —» Benia pictures production
15:04:57Николя Верт «История советского государства: 1900–1991» —» Benia pictures production
15:04:57Xiaomi Smart Scale 2 —» Benia pictures production
15:04:57Зимой на горе не был — не мужик —» Benia pictures production
15:04:57Такса и её хипстеры —» Benia pictures production
15:04:57Не мешки таскать —» Benia pictures production
15:04:57Лесное хозяйство —» Benia pictures production