WordPress – Reset password in database

How to reset a WordPress password directly in the database (using PHPMyAdmin)?

METHOD 1

Go to
https://www.md5hashgenerator.com/
and calculate the MD5 hash for the password you want to use.

Open the WordPress users table (in PHPMyAdmin) wp-users and paste the MD5 hash into your user_pass field.

 

METHOD 2 (SNEAKY ONE!)

  • Open the WordPress users table (in PHPMyAdmin) wp-users.
  • Select a user with Administrator rights.
  • Back up the (encrypted) password and email address of that user in a text file.
  • Change the email address to your own email address.
  • Go to the WP login page and click the ‘Lost your password?’ link.
  • Enter your own email address (the one you entered in the database).
  • Click the ‘reset password’ link in the email that you receive from WordPress.
  • Enter a new password and you are in!
  • Create a new user for yourself, with Administrator rights.
  • In PHPMyAdmin, restore the password and email for the user you abused.
  • DONE 😉

Resource:
http://www.wpbeginner.com/beginners-guide/how-to-reset-a-wordpress-password-from-phpmyadmin/


WordPress – Convert INNODB tables to MyISAM

How to convert all INNODB tables in the database to MyIsam?

<?php
    // CONVERT ALL INNODB TABLES TO MyISAM
    
    // connect your database here first 
    $sv_db_host     = '';
    $sv_db_user     = '';
    $sv_db_password = '';
    $sv_db_name     = '';

    $connect = mysql_connect($sv_db_host,$sv_db_user,$sv_db_password); 
    mysql_select_db ($sv_db_name);

    // Actual code starts here 

    $sql = "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
        WHERE TABLE_SCHEMA = '".$sv_db_name."' 
        AND ENGINE = 'INNODB'";

    $rs = mysql_query($sql);

    while($row = mysql_fetch_array($rs))
    {
        $tbl = $row[0];
        echo "ALTER TABLE `$tbl` ENGINE=MyISAM;<br />";
        $sql = "ALTER TABLE `$tbl` ENGINE=MyISAM";
        mysql_query($sql);
    }
?>

Try this small WordPress plugin (InnoDB from / to MyISAM):
rvg-innodb-myisam


Oracle – Find Keywords in All Tables and Columns

A PL-SQL script for finding keywords in all tables and columns of an Oracle database.

SET SERVEROUTPUT ON SIZE 100000

DECLARE
   v_match_count   INTEGER;
   v_keyword       VARCHAR2(100) := 'keywordtofind';
BEGIN
   FOR t
      IN (SELECT owner, table_name, column_name
            FROM all_tab_columns
           WHERE     owner = 'XXX_ADMIN'
                 AND data_type LIKE '%CHAR%'
                 AND data_length >= LENGTH(v_keyword)
                 AND table_name LIKE 'XXX_%')
   LOOP
      EXECUTE IMMEDIATE
            'SELECT COUNT(*) FROM '
         || t.owner
         || '.'
         || t.table_name
         || ' WHERE LOWER('
         || t.column_name
         || ') LIKE ''%'''
         || ' || LOWER(:1) || '
         || '''%'''
         INTO v_match_count
         USING v_keyword;

      IF v_match_count > 0
      THEN
         DBMS_OUTPUT.put_line (
            t.table_name || ' ' || t.column_name || ' ' || v_match_count);
      END IF;
   END LOOP;
END;
/