Archive for the ‘PHP/MySQL/MSSQL’ Category

How To – Fix MySQL Option Without Preceding Group

Май 8th, 2012

Background Knowledge


You try starting, stopping or connecting to MySQL and receive the following error, “Error: Found option without preceding group in config file: /etc/mysql/conf.d/char_collation_set.cnf at line: 1″. The error message my vary but comes to the same issue. MySQL may not start or might experience connectivity issues.

This issue was experienced on Debian Squeeze v6.04 AMD64 system with MySQL v14.14 Distrib 5.1.61.

Solution


This issue is caused by a improperly formatted MySQL configuration file(s) and refers to one missing the group heading (e.g. [mysqld], [mysqld_safe], etc.).

Source: MySQL 5.1 Reference Manual :: 4.2.3.3. Using Option Files
Source: [Solved] Mysql won’t start. my.cnf problem.


PlanetMySQL Voting: Vote UP / Vote DOWN

How To – Resolve MySQL Error Incorrect Key File for Table

Март 29th, 2012

Background Knowledge


I using PHP v5.3.3-7 PDO running a MySQL v14.14 Distrib 5.1.49 on Debian v6.0.4 64-bit and executing a SQL load data infile statement.

I received “PHP Warning: PDOStatement::execute(): SQLSTATE[HY000]: General error: 126 Incorrect key file for table ‘/tmp/#sql_66f_0.MYI’; try to repair it”. My database table in this instance is using the storage engine of InnoDB and therefore one can not use the “repair table”.

From my experience I’ve found that this error can mean one of two issues however I have not found information from MySQL confirming this.

Solution – Repair Table


The error message may mean the database table is corrupted and requires a repair.

  1. Run repair table on the associated database table.
  2. Re-run the previous query.
  3. The issue will now be resolved.

Solution – Free Disk Space


The error message may mean the system does not have enough free disk space.

  1. Verify the free disk space. On Linux execute at the console “df -h”. On Windows open “My Computer” to see free space available.
  2. If low or out of disk space, free up some space or follow the next steps to change MySQL server setting to point to a new temporary path.
  3. Edit the MySQL server configuration file, my.cnf (on Debian, /etc/mysql/my.cnf).
  4. Change the “tmpdir” path variable to a new location with more available free disk space (ex. /var/tmp or D:\temp).
  5. Stop MySQL daemon/service and then start MySQL daemon/service for the configuration changes to take affect.

PlanetMySQL Voting: Vote UP / Vote DOWN

TaskFreak! v0.6.2 – Customizing Status

Октябрь 3rd, 2011

Background Knowledge


The progress of a task in TaskFreak! is shown as a percentage value and is not exactly visually appealing to quickly spot the progress. With a few minor alterations we can show the percentage completed bar that fills as the task progresses and a gradient bar indicating the progress along with the percentage value.

This solution was posted by Searcher at Re: Taskfreak Customizing Status.

Solution


  1. Edit at line #268 as shown below.
    Cod Before
    268
    
    <th width="<?php echo FRK_STATUS_LEVELS * 2; ?>%" onclick="freak_sort('statusKey')" colspan="< ?php echo FRK_STATUS_LEVELS ?>" class="sortable">< ?php echo (FRK_STATUS_LEVELS == 1)?'X':$langForm['status']; ?></th>
    Code After
    268
    
    <th width="80" onclick="freak_sort('statusKey')" class="sortable">< ?php echo (FRK_STATUS_LEVELS == 1)?'X':$langForm['status']; ?></th>
  2. Edit at line #382
    Code Before
    < ?php
                        $s = $objItem->itemStatus->statusKey;
                        for ($i = 0; $i < FRK_STATUS_LEVELS; $i++) {
                            $j = ($i < $s)?(FRK_STATUS_LEVELS - $i):0;
                    ?>
                            <td id="est<?php echo ($i+1).$objItem->id; ?>" class="sts< ?php echo $j; ?>"< ?php
                            if ($objUser->checkLevel(14) || $objItem->checkRights($objUser->id,8,true))  {
                                echo ' onclick="freak_sts('.$objItem->id.','.($i+1).')" style="cursor:pointer"';
                            }
                        ?>>&nbsp;</td>
                    < ?php
                        }
                    ?>
    Code After
    <!-- status bar update -->
              <td>
                <table width="100%" cellpadding="0" cellspacing="0">
                  <tr>
                    < ?php
                    $s = $objItem->itemStatus->statusKey;
                    for ($i = 0; $i < FRK_STATUS_LEVELS; $i++) {
                      $j = ($i < $s)?(FRK_STATUS_LEVELS - $i):0;
                      ?>
                      <td width="10" onmouseover="this.style.cursor='pointer'" id="est<?php echo ($i+1).$objItem->id; ?>" class="sts< ?php echo $j; ?>"< ?php if ($objUser->checkLevel(14) || $objItem->checkRights($objUser->id,8,true))  { echo ' onclick="freak_sts('.$objItem->id.','.($i+1).')" style="cursor:pointer"'; } ?>>&nbsp;</td>
                      < ?php } ?>
                      <td style="border:0"></td>
                      <td id="status_perc_<?php echo $objItem->id; ?>" style="border:0; font-size:8px; color:#000" align="right">&nbsp;< ?php echo ($s*20)."%"; ?></td>
                    </tr>
                    <tr><td style="border:0; height:2px"></td></tr>
                    <tr>
                      <td colspan="7" style="border:0"><img id="status_bar_<?php echo $objItem-/>id; ?>" src="skins/status.jpg" height="5" width="< ?php echo ($s*16); ?>" /></td>
                  </tr>
                </table>
              </td>
    <!-- status bar update -->
  3. Download the status gradient bar image file from “http://demofreak.dracon.biz/skins/status.jpg” and the copy image file to the /taskfreak/skins/ directory.

Source: Taskfreak Customizing Status


PlanetMySQL Voting: Vote UP / Vote DOWN

TaskFreak! v0.6.2 – Customizing Status

Октябрь 3rd, 2011

Background Knowledge


The progress of a task in TaskFreak! is shown as a percentage value and is not exactly visually appealing to quickly spot the progress. With a few minor alterations we can show the percentage completed bar that fills as the task progresses and a gradient bar indicating the progress along with the percentage value.

This solution was posted by Searcher at Re: Taskfreak Customizing Status.

Solution


  1. Edit at line #268 as shown below.
    Cod Before
    268
    
    <th width="<?php echo FRK_STATUS_LEVELS * 2; ?>%" onclick="freak_sort('statusKey')" colspan="< ?php echo FRK_STATUS_LEVELS ?>" class="sortable">< ?php echo (FRK_STATUS_LEVELS == 1)?'X':$langForm['status']; ?></th>
    Code After
    268
    
    <th width="80" onclick="freak_sort('statusKey')" class="sortable">< ?php echo (FRK_STATUS_LEVELS == 1)?'X':$langForm['status']; ?></th>
  2. Edit at line #382
    Code Before
    < ?php
                        $s = $objItem->itemStatus->statusKey;
                        for ($i = 0; $i < FRK_STATUS_LEVELS; $i++) {
                            $j = ($i < $s)?(FRK_STATUS_LEVELS - $i):0;
                    ?>
                            <td id="est<?php echo ($i+1).$objItem->id; ?>" class="sts< ?php echo $j; ?>"< ?php
                            if ($objUser->checkLevel(14) || $objItem->checkRights($objUser->id,8,true))  {
                                echo ' onclick="freak_sts('.$objItem->id.','.($i+1).')" style="cursor:pointer"';
                            }
                        ?>>&nbsp;</td>
                    < ?php
                        }
                    ?>
    Code After
    <!-- status bar update -->
              <td>
                <table width="100%" cellpadding="0" cellspacing="0">
                  <tr>
                    < ?php
                    $s = $objItem->itemStatus->statusKey;
                    for ($i = 0; $i < FRK_STATUS_LEVELS; $i++) {
                      $j = ($i < $s)?(FRK_STATUS_LEVELS - $i):0;
                      ?>
                      <td width="10" onmouseover="this.style.cursor='pointer'" id="est<?php echo ($i+1).$objItem->id; ?>" class="sts< ?php echo $j; ?>"< ?php if ($objUser->checkLevel(14) || $objItem->checkRights($objUser->id,8,true))  { echo ' onclick="freak_sts('.$objItem->id.','.($i+1).')" style="cursor:pointer"'; } ?>>&nbsp;</td>
                      < ?php } ?>
                      <td style="border:0"></td>
                      <td id="status_perc_<?php echo $objItem->id; ?>" style="border:0; font-size:8px; color:#000" align="right">&nbsp;< ?php echo ($s*20)."%"; ?></td>
                    </tr>
                    <tr><td style="border:0; height:2px"></td></tr>
                    <tr>
                      <td colspan="7" style="border:0"><img id="status_bar_<?php echo $objItem-/>id; ?>" src="skins/status.jpg" height="5" width="< ?php echo ($s*16); ?>" /></td>
                  </tr>
                </table>
              </td>
    <!-- status bar update -->
  3. Download the status gradient bar image file from “http://demofreak.dracon.biz/skins/status.jpg” and the copy image file to the /taskfreak/skins/ directory.

Source: Taskfreak Customizing Status


PlanetMySQL Voting: Vote UP / Vote DOWN

TaskFreak! v0.6.2 – Add Unique Ticket/Task Number

Июль 14th, 2010

Background Knowledge


TaskFreak! does not show within the interface a unique ticket/task number. Depending on the use of TaskFreak! having such a value can have it’s benefits. Since this unique value does already exist in the back end, it will be fairly trivial to render this value within the task list and task details panel. I will show you how this is done using Searcher’s solution posted in the TaskFreak! Forum. There has been some modifications but not much.

Solution


  1. Edit index.php in the root of TaskFreak!. Add the table header column just below line # 248 as follows.
    2
    
    <th width="3%" onclick="freak_sort('itemId')" class="sortable" >< ?php echo $langForm['id']; ?></th>
  2. Next add the table data just below line # 302 as follows.
    2
    
    <td style="text-align:right;">< ?php echo $objItem->id; ?>&nbsp;</td>
  3. Edit /include/html/xajax_panel_view.php just below line # 5 just before the priority column as follows.
    6
    7
    8
    9
    10
    
    <div id="fid">
            	<div class="flabel">< ?php echo $GLOBALS['langForm']['id']; ?></div>
            	<div class="vid">< ?php echo $objTask->id; ?></div>
            < /div>
    </div>
  4. Edit /include/language/en/freak.php just below line # 46 as follows.

    Note: Each interface language file will be required to be edited if you desire to use them. If you do not do so, you will receive error messages and it may cripple TaskFreak!

    2
    
    'id' => 'ID',
  5. Edit applicable skins’ CSS in this example /skins/redfreak/css/freak.css just below line # 550.
    9
    10
    11
    12
    13
    14
    15
    16
    
    #fid 
    {
    	float: left;
    	width: 80px;
    	height:32px;
    	margin-left: 3px;
    	font-weight: bold;
    }
  6. Edit applicable skins’ CSS in this example /skins/redfreak/css/freak.css ID #fpro and remove “margin-left: 3px;”.

Source: Unique Ticket/ToDo Follow Number – Further prioritizing


PlanetMySQL Voting: Vote UP / Vote DOWN