Tag: database

  • Database migration in wordpress

    Database migration of wp sites in four steps using command line Assumption: mysql username: root mysql password: root Step-1: Backing up data base form old site: mysqldump -u[database_username] -p[database_password] [database_name] > [path][database_name.sql] Example: #mysqldump -uroot -proot wp_db >  /root/wp_db.sql Step-2: File Transfer Transfer  wp_db.sql file to server. Step-3: Create/Restore database #mysql -uroot -proot mysql>create database…

  • Mysql db backup batch script for windows

    This is an example of very simple mysql database backup batch script for windows machines: @echo off REM “MySql Backup Initiated” REM “Mysql username/password” SET mysqlUsername=”root” SET mysqlPassword=”root” REM “Creating folder with date stamp” set datestamp=%date:~-4,4%%date:~-10,2%%date:~7,2% mkdir D:\backup\dbBackup\mysql_%datestamp% SET backupDir=”D:\backup\dbBackup\mysql_%datestamp%” REM “Database backup Started” SET mysqlCmdDir=”c:\Program Files\MySQL\MySQL Server 5.5\bin” cd %mysqlCmdDir% mysqldump -uroot -proot exampledb…