Howto: How to Reset the MySQL Root Password

The following procedure can be used to reset the password for any MySQL root accounts on Linux and Unix (*nix). The instructions assume that you have got the proper permissions on the host system.

Stop the MySQL daemon process

sudo /etc/init.d/mysql stop

Create a text file /home/me/mysql.sql and place the following statements in it. Replace the password with the password that you want to use

UPDATE mysql.user SET Password=PASSWORD('a_new_password') WHERE User='root';
FLUSH PRIVILEGES;

The UPDATE and FLUSH statements each must be written on a single line. The UPDATE statement resets the password for all existing root accounts, and the FLUSH statement tells the server to reload the grant tables into memory.

Start the MySQL server with the special –init-file option

mysqld_safe --init-file=/home/me/mysql.sql

Press Ctrl+C and then start the MySQL server again by /etc/init.d/mysql start and you are done.

Related posts:

  1. Howto Recover a Linux Root Password
  2. Executing SQL Statements from a Text File
  3. How to hack Windows password with Ophcrack
  4. Crack Windows Password
  5. Optimize MySQL Performance With MySQLTuner
  6. Optimize MySQL for Low Memory Use
  7. How to reset a Nokia
  8. MySQL Optimization and Performance Tips
  9. How to do MySQL replication (dual-master / multi-master)
  10. Howto: Resize Xen Loop Disk Image

Comments

Crack Windows Password

THC-Hydra – the best parallized login hacker: for Samba, FTP, POP3, IMAP, Telnet, HTTP Auth, LDAP, NNTP, MySQL, VNC, ICQ, Socks5, PCNFS, Cisco and more.

Download THC-Hydra, extract and compile

wget http://freeworld.thc.org/releases/hydra-5.4-src.tar.gz
tar zxvf hydra-5.4-src.tar.gz
cd hydra-5.4-src
./configure --disable-xhydra --prefix=~/bin
make
make install
Hydra v5.4 [http://www.thc.org] (c) 2009 by van Hauser / THC 

Syntax: hydra [[[-l LOGIN|-L FILE] [-p PASS|-P FILE]] | [-C FILE]] [-e ns]
 [-o FILE] [-t TASKS] [-M FILE [-T TASKS]] [-w TIME] [-f] [-s PORT] [-S] [-vV]
 server service [OPT]

Options:
  -R        restore a previous aborted/crashed session
  -S        connect via SSL
  -s PORT   if the service is on a different default port, define it here
  -l LOGIN or -L FILE login with LOGIN name, or load several logins from FILE
  -p PASS  or -P FILE try password PASS, or load several passwords from FILE
  -e ns     additional checks, "n" for null password, "s" try login as pass
  -C FILE   colon seperated "login:pass" format, instead of -L/-P options
  -M FILE   server list for parallel attacks, -T TASKS sets max tasks per host
  -o FILE   write found login/password pairs to FILE instead of stdout
  -f        exit after the first found login/password pair (per host if -M)
  -t TASKS  run TASKS number of connects in parallel (default: 16)
  -w TIME   defines the max wait time in seconds for responses (default: 30)
  -v / -V   verbose mode / show login+pass combination for each attempt
  server    the target server (use either this OR the -M option)
  service   the service to crack. Supported protocols: [telnet ftp pop3 imap smb
 smbnt http https http-proxy cisco cisco-enable ldap mssql mysql nntp vnc rexec
socks5 snmp cvs icq pcnfs sapr3 ssh2 smtp-auth]
  OPT       some service modules need special input (see README!)

Use HYDRA_PROXY_HTTP/HYDRA_PROXY_CONNECT and HYDRA_PROXY_AUTH env for a proxy.
Hydra is a tool to guess/crack valid login/password pairs - use allowed only for

legal purposes! If used commercially, name and web address must be mentioned in
the report. You can always find the newest version at http://www.thc.org

Related posts:

  1. Crack or Recover Password Protected Excel Spreadsheet
  2. HackerGuide: Crack Password Encrypted Zip-files
  3. Howto: How to Reset the MySQL Root Password
  4. Crack zip password with fcrackzip
  5. Crack or Recover Read-only Password Protected Word Document
  6. How to hack Windows password with Ophcrack
  7. Crack mdb Password
  8. Recover (Crack) a password from a Microsoft Access Database (mdb)
  9. Howto Crack Rar, 7z, and zip files in Linux
  10. Crack Cisco VPN (hack)

Comments

MySQL Concatenate: Adding String At The End Of Field Data

From time to time it is useful to be able to append a string or data to an existing data of a data field by using concat function in MySQL.

For example we want to add site signature at the end of the comments posted by users.

concat(field_name,”string to add”)

Now let us see how it is used in a MySQL table query.

update comments set field_name=concat(field_name,’string to add’) where id=’1′;

Related posts:

  1. Mysql Data Import
  2. Optimize MySQL Performance With MySQLTuner
  3. Howto: How to Reset the MySQL Root Password
  4. MySQL Optimization and Performance Tips
  5. Simple RADIUS XML dump PHP script
  6. MySQL: Remove Duplicate Entries
  7. Slow Query Log Analyzes Tools
  8. MySQL search and replace
  9. MDB Tools to export (migrate) from mdb (Microsoft Access format) to MySQL
  10. Optimize MySQL for Low Memory Use

Comments

Compressing mysqldump output – mysql, gzip, bzip2 and LZMA (7z)

Do a mysql dump and compress directly with gzip
mysqldump < mysqldump options> | gzip > outputfile.sql.gz

Gunzip and import using gzip
gunzip < outputfile.sql.gz | mysql < mysql options>

Do a mysql dump and compress directly with bzip2
mysqldump < mysqldump options> | bzip2 > outputfile.sql.bz2

Bunzip2 and import using bzip2
bunzip2 < outputfile.sql.bz2 | mysql < mysql options>

Do a mysql dump and compress directly with lzma
mysqldump < mysqldump options> | lzma > outputfile.sql.lzma

Unlzma and import using unlzma
unlzma < outputfile.sql.lzma | mysql < mysql options>

Related posts:

  1. Optimize MySQL for Low Memory Use
  2. Howto: How to Reset the MySQL Root Password
  3. Optimize MySQL Performance With MySQLTuner
  4. Sun acquires MySQL
  5. MySQL Optimization and Performance Tips
  6. MDB Tools to export (migrate) from mdb (Microsoft Access format) to MySQL
  7. MySQL 5.0 Release Candidate
  8. MySQL Performance Monitoring and Optimization Tools
  9. MySQL Concatenate: Adding String At The End Of Field Data
  10. Howto Use URL Rewriting for PHP Web Applications

Comments (1)

Slow Query Log Analyzes Tools

From time to time I’m doing some experiments on my server that is hosting this blog. Recently I found out that my blogging software used here, Wordpress, missed some indexes in the MySQL database.

This article from MySQL Performance Blog explains how to log slow queries and how to identify queries, which do not use indexes.

MySQL has simple but quite handy feature – slow query log, which allows you to log all queries which took over define number of seconds to execute. There is also an option to enable logging queries which do not use indexes even if they take less time (–log-queries-not-using-indexes)

Slow query log is great to spot really slow queries which are often good candidates for optimization but it has few serious problems which limits extent to which it is helpful. First – it only allows you to set slow query time in seconds, having 1 second minimum value. For most of interactive applications this is way too large – if you’re developing Web application you probably want whole page to be generated less in 1 second, which issues many queries during generation. Second – if you enable option to log queries which do not use indexes it well can be flooded with fast and efficient queries, which just happen to do full table scans – for example if you would be having drop down list of states in your application and use SELECT * FROM STATES for that it would trigger and log the query.

Related posts:

  1. Optimize MySQL Performance With MySQLTuner
  2. MySQL Performance Monitoring and Optimization Tools
  3. Troubleshooting PHP Sqlite Query Error: Unable to open database
  4. Windows Developers Begin Slow Defection to Linux
  5. Optimize MySQL for Low Memory Use
  6. MDB Tools to export (migrate) from mdb (Microsoft Access format) to MySQL
  7. Howto: How to Reset the MySQL Root Password
  8. Dell: Linux Rolls On
  9. MySQL Concatenate: Adding String At The End Of Field Data
  10. Linux Terminal Speed Performance Comparison

Comments

Opening and Forwarding Ports To A VirtualBox-based Guest

Here are the commands used to open and forward the host’s port 2222 to the guest’s port 22 (SSH Server Port).

Type this into a terminal:


VBoxManage setextradata nameofyourguest "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 2222
VBoxManage setextradata nameofyourguest "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22
VBoxManage setextradata nameofyourguest "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP

Could also be used to forward PostgreSQL and HTTP:


VBoxManage setextradata nameofyourguest "VBoxInternal/Devices/pcnet/0/LUN#0/Config/postgresql/HostPort" 5432
VBoxManage setextradata nameofyourguest "VBoxInternal/Devices/pcnet/0/LUN#0/Config/postgresql/GuestPort" 5432
VBoxManage setextradata nameofyourguest "VBoxInternal/Devices/pcnet/0/LUN#0/Config/postgresql/Protocol" TCP
VBoxManage setextradata nameofyourguest "VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/HostPort" 8080
VBoxManage setextradata nameofyourguest "VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/GuestPort" 80
VBoxManage setextradata nameofyourguest "VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/Protocol" TCP

Related posts:

  1. Howto Access via ssh a Virtualbox Guest machine
  2. Sockets Programming in Java
  3. Convert from VMWare To VirtualBox
  4. How to mount bin / cue image files in Linux
  5. MySQL Optimization and Performance Tips
  6. Gaming with Intel GMA 900, GMA 950, 915 or 945 GL/GV/GM Based Chipsets

Comments (2)

Debian Backports

instructions [Debian Backports]

Using backports.org is very simple:

1. Add this line

deb http://www.backports.org/debian etch-backports main contrib non-free

to your /etc/apt/sources.list.

2. Run apt-get update

3. All backports are deactivated by default. If you want to install something from backports run:

apt-get -t etch-backports install “package”

Of course, you can use aptitude as well:

aptitude -t etch-backports install “package”

Related posts:

  1. Howto Install Sun Java on Debian Etch
  2. Upgrade Debian Etch to Debian Lenny
  3. Howto install Java on Debian Sarge
  4. Howto Install Oracle on Debian
  5. dos2unix on Ubuntu and Debian
  6. Ubuntu Howto: Install Oracle
  7. Howto: Install Ruby and Rails on Debian or Ubuntu
  8. Update entry on Xen on Debian Etch
  9. Installing Xen on Debian Etch 4.0
  10. Howto install Xen on Debian Sarge (stable)

Comments (1)

MySQL Performance Monitoring and Optimization Tools

Comments (1)

« Previous entries Next Page » Next Page »