Thursday, August 20, 2026

How to take backup of MSQL database - MYsql database backup by bat file or by batch file

 C:\Program Files\MySQL\MySQL Workbench 8.0 CE>mysqldump -u root -p  eoffice_db documents >d:/backup_filename.sql


@echo off

:: Configuration

set DB_USER=root

set DB_PASS=12345

set DB_NAME=eoffice_DB

set BACKUP_DIR=C:\eoffice_DB\documents


:: 1. SET YOUR TABLE NAME HERE

:: Leave blank for full DB, or type a single table (e.g., users)

set TABLE_NAME=documents


:: Get Date Format safely (YYYYMMDD) regardless of Windows regional settings

for /f "tokens=2 delims==" %%i in ('wmic os get localdatetime /value') do set LDT=%%i

set BACKUP_DATE=%LDT:~0,4%%LDT:~4,2%%LDT:~6,2%


:: Adjust file name based on whether a table is specified

if "%TABLE_NAME%"=="" (

    set BACKUP_FILE=%BACKUP_DIR%\%DB_NAME%_%BACKUP_DATE%.sql

) else (

    set BACKUP_FILE=%BACKUP_DIR%\%DB_NAME%_%TABLE_NAME%_%BACKUP_DATE%.sql

)


:: Ensure target directory exists

if not exist "%BACKUP_DIR%" mkdir "%BACKUP_DIR%"


:: Execute mysqldump

"C:\Program Files\MySQL\MySQL Workbench 8.0 CE\mysqldump.exe" -u%DB_USER% -p%DB_PASS% %DB_NAME% %TABLE_NAME% > "%BACKUP_FILE%"


:: Optional: Delete files older than 30 days

forfiles /p "%BACKUP_DIR%" /s /m *.sql /d -30 /c "cmd /c del @path"


Thursday, July 9, 2026

VS code color change of font in menu - In side bar - explorer - Visual code color change of font

 

In settings.json change below code:-


 "workbench.colorCustomizations": {

    // Changes the default text color of the sidebar/explorer

    "": "#758b7c", 

    "sideBar.foreground":"default",

    // Changes the text color of the currently selected/focused file

    "list.focusForeground": "#FFD700", 

    "menu.foreground":"#020202",

    // Changes the text color of active files or items when hovering

    "list.activeSelectionForeground": "#8400ff31",

    "list.hoverForeground": "#6e0ad2",

    "menu.selectionForeground": "#FFFFFF",

"menu.selectionBackground": "#be1919c6"


}