Wednesday, October 2, 2024

XAMPP MySql Crash issue

 This is as a result of some files in C:\xampp\mysql\data\mysql getting corrupted.

Solution:

  1. Back up C:\xampp\mysql\data
  2. Copy all file C:\xampp\mysql\backup
  3. Paste and replace existing file in: C:\xampp\mysql\data, except for the ibdata1 file.
  4. Leaving ibdata1 will help against table does not exist error.

Thursday, August 3, 2023

How to Reset the Laravel Application's Forgotten Password when we have access to Database?


Run this below command to create a Controller

php artisan make:controller TestController


This will create a TestController.php in your controller directory and copy the BOLD text to file created.

<?php


namespace App\Http\Controllers;

use Illuminate\Http\Request;

use Illuminate\Support\Facades\Hash;

use Illuminate\Support\Facades\DB;

class TestController extends Controller

{

    public function ResetAdminPassword()

    {

//Assume user id of admin is 1

$user_id=1;

        $myNewPassword='P@ssword';

$password = Hash::make($myNewPassword);

  DB::table('users')->where('id', '=', $user_id)->update([

                'password' => $password 

        ]);

    }

}

 

Friday, March 25, 2022

How to find the saved Wifi Credentials in windows?

 

This command will list the saved wifi list

netsh wlan show profile






Now try with the below command with your connection name

netsh wlan show profile "<ConnectionName>" key=clear

Example: netsh wlan show profile "Galaxy M3256E2" key=clear



Word Press asking for FTP to install Plugins?

Wordpress may ask for FTP credentials for installing plugins in some hosting. To avoid that we can add this below line in wp-config.php

define('FS_METHOD', 'direct');

Saturday, December 25, 2021

Hosting Laravel Application in CPanel public folder issue.

 In Laravel Application, We have have our index.php file inside public folder, but in CPanel by default they have public_html directory as home directory.

To avoid this problem, we need to create .htaccess file in public folder with the below content.

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteRule ^(.*)$ public/$1 [L]

</IfModule> 

Wednesday, October 13, 2021

Laravel Creating or Updating Tables Using Migration Command

For Creating table:

php artisan make:migration create_users_table --create=users


For Updating/Changing the existing Table: 

php artisan make:migration update_users_table --table=users

XAMPP MySql Crash issue

 This is as a result of some files in C:\xampp\mysql\data\mysql getting corrupted. Solution: Back up C:\xampp\mysql\data Copy all file C:\xa...