Showing posts with label mysql. Show all posts
Showing posts with label mysql. Show all posts

Sunday, March 25, 2012

error while importing DB in mysql

I upgraded my local testlink mysql server to 5.5.20, and I was trying to import testlink DB to the new version, I was facing an error

error:

#1100 - Table 'pma_column_info' was not locked with LOCK TABLES

I tried to look for solution for it online, found some people suggesting commenting the following line in PhpMyAdmin config file

$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';

tried this, but the import process with giving this time different error

#1146 - Table 'testlink.pma_tracking' doesn't exist

I tried commenting all Advanced phpMyAdmin features, still the import wasn’t working, with different error this time

I read in some forums that I need to install DB create script for advanced features located in

C:\Program Files (x86)\EasyPHP-5.3.9\modules\phpmyadmin\scripts\create_tables.sql

still I was having errors while importing

I noticed in PhpMyConfig file that there are 2 lines for advanced features user name and password, and the lines were commented, I uncommented these 2 lines, uncommented the advanced features configuration, set the user name and password for the root user, saved the config file, then tried to import, worked perfect

/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'root';
$cfg['Servers'][$i]['controlpass'] = 'password';

Wednesday, December 7, 2011

testlink: setting up MySQL Daily backup job

We wanted to keep our data safe, so we started taking backups using phpmyadmin, and because of forgetting sometimes, we thought of automating the backup

After doing some search, using the information from this page http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html

I created a batch file, called DailyBackup.bat for example

and wrote the below in the batch file

@ECHO OFF
for /f "tokens=1-4 delims=/ " %%a in ('date/t') do (
set dw=%%a
set mm=%%b
set dd=%%c
set yy=%%d
)

SET bkupdir="path to backup folder"
SET mysqldir="C:\Program Files (x86)\EasyPHP5.3.0\mysql"
SET dbname=testlink

SET dbuser=username

SET password=password

set zip="C:\Program Files (x86)\GnuWin32\bin\gzip.exe"
@ECHO Beginning backup of %dbname%...

%mysqldir%\bin\mysqldump -B %dbname% -u %dbuser% –p%password% | %zip% > %bkupdir%\dbBkup_%dbname%_%dd%%mm%%dw%.sql.gzip

The above batch file needs gzip to be installed

Then I created a scheduled task that runs daily and executes the above batch file