zeldor.biz

Linux, programming and more

Copyright © 2023
Log in

Show MySQL restore progress

January 13, 2011 by Igor Drobot Leave a Comment

Sometimes if I work with really huge MySQL databases, I miss the progress bar of the restore progress.
I found a little solution to see the progress Bar

Description:
pv allows a user to see the progress of data through a pipeline, by giving information such as time elapsed, percentage completed (with progress bar), current throughput rate, total data transferred, and ETA.

1
2
pv database.sql | mysql -D databasename -pyourpassword
948.4MB 0:00:03 [22.7MB/s] [=====>               ] 21% ETA 0:00:11

pv database.sql | mysql -D databasename -pyourpassword 948.4MB 0:00:03 [22.7MB/s] [=====> ] 21% ETA 0:00:11

Filed Under: Linux, MySQL Tagged With: database restore, MySQL

Nikto – vulnerabilities scanner

December 6, 2010 by Igor Drobot Leave a Comment


Nikto is an Open Source (GPL) web server scanner which scans your webserver against more than 3500 dangerous files/CGIs, outdated version checking, It has a very good plugin support
Official site

To install in ubuntu / debian

1
$ apt-get install nikto

$ apt-get install nikto

For simple test:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
firewall ~ # nikto -h debianuser.org
---------------------------------------------------------------------------
- Nikto 2.02/2.03     -     cirt.net
+ Target IP:       188.40.116.206
+ Target Hostname: debianuser.org
+ Target Port:     80
+ Start Time:      2010-12-07 10:45:55
---------------------------------------------------------------------------
+ Server: Apache
+ OSVDB-3092: GET /img/ : This may be interesting...
+ OSVDB-3268: GET /icons/ : Directory indexing is enabled: /icons
+ 4347 items checked: 2 item(s) reported on remote host
+ End Time:        2010-12-07 10:49:45 (230 seconds)
---------------------------------------------------------------------------
+ 1 host(s) tested

firewall ~ # nikto -h debianuser.org --------------------------------------------------------------------------- - Nikto 2.02/2.03 - cirt.net + Target IP: 188.40.116.206 + Target Hostname: debianuser.org + Target Port: 80 + Start Time: 2010-12-07 10:45:55 --------------------------------------------------------------------------- + Server: Apache + OSVDB-3092: GET /img/ : This may be interesting... + OSVDB-3268: GET /icons/ : Directory indexing is enabled: /icons + 4347 items checked: 2 item(s) reported on remote host + End Time: 2010-12-07 10:49:45 (230 seconds) --------------------------------------------------------------------------- + 1 host(s) tested

Filed Under: Bash, Debian, Linux, MySQL Tagged With: apache security, Nikto, Security scanner, vulnerabilities finder

MySQL: Show processlist every second

November 28, 2010 by Igor Drobot 5 Comments

MySQL-Logo

1
mysqladmin -u root -p -i 1 processlist

mysqladmin -u root -p -i 1 processlist

-u username
-p you will be promted for a password
-i 1 interval one second

Output will see like this one:

1
2
3
4
5
6
7
8
9
+--------+------+-------------------+-----+---------+------+-------+------------------+
| Id     | User | Host              | db  | Command | Time | State | Info             |
+--------+------+-------------------+-----+---------+------+-------+------------------+
| 424111 | db4  | 192.168.2.1:58431 | db4 | Sleep   | 15   |       |                  |
| 424195 | db4  | 192.168.2.1:50531 | db4 | Sleep   | 1    |       |                  |
| 424483 | db3  | 192.168.2.1:41503 | db3 | Sleep   | 464  |       |                  |
| 424490 | db3  | 192.168.2.1:41513 | db3 | Sleep   | 443  |       |                  |
| 424551 | root | localhost         |     | Query   | 0    |       | show processlist |
+--------+------+-------------------+-----+---------+------+-------+------------------+

+--------+------+-------------------+-----+---------+------+-------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +--------+------+-------------------+-----+---------+------+-------+------------------+ | 424111 | db4 | 192.168.2.1:58431 | db4 | Sleep | 15 | | | | 424195 | db4 | 192.168.2.1:50531 | db4 | Sleep | 1 | | | | 424483 | db3 | 192.168.2.1:41503 | db3 | Sleep | 464 | | | | 424490 | db3 | 192.168.2.1:41513 | db3 | Sleep | 443 | | | | 424551 | root | localhost | | Query | 0 | | show processlist | +--------+------+-------------------+-----+---------+------+-------+------------------+

Filed Under: MySQL Tagged With: Database, MySQL, Process List

MySQL – Database size

June 6, 2010 by Igor Drobot Leave a Comment

As I know, there are two ways to calculate the MySQL database size:

First one:

1
du -shc /var/lib/mysql/*

du -shc /var/lib/mysql/*

Second one:

1
SELECT table_schema ,SUM( data_length + index_length) / 1024 / 1024 "Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema;

SELECT table_schema ,sum( data_length + index_length) / 1024 / 1024 "Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema;

Filed Under: Bash, Linux, MySQL Tagged With: MySQL

  • « Previous Page
  • 1
  • 2