Home |  MySQL Buzz |  FAQ |  Feeds |  Submit your blog feed |  Feedback |  Archive |  Aggregate feed RSS 2.0 English Deutsch Español Français Italiano 日本語 Русский Português 中文
Showing entries 1 to 12

Displaying posts with tag: How Tos (reset)

How To – Configure MySQL to Use UTF-8
+1 Vote Up -1Vote Down

Background Knowledge


Using the character set UTF-8 allows for the use of any language, can represent every character in the Unicode character set and is backward compatibility with ASCII. Not to mention is can handle any platform and be sent through many different systems without corruption. With such advantages this is why so many are making the switch.

The following instructions were done on Debian Squeeze v6.04 AMD64 operating system using MySQL v14.14 Distrib 5.1.61.

Solution – Server Configuration


At present MySQL is configured by default to use “latin1″ character set. Here’s how to change MySQL configuration to use UTF-8 character set and collation.

  • Check MySQL’s current configuration, run the following two SQL statements.
    1
    2
    
    SHOW VARIABLES LIKE '%collation%'; 
    SHOW
  •   [Read more...]
    How To – Fix MySQL Option Without Preceding Group
    +0 Vote Up -0Vote Down

    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:   [Read more...]

    How To – Resolve MySQL Error Incorrect Key File for Table
    +0 Vote Up -0Vote Down

    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.

  • Run
  •   [Read more...]
    How To – Convert MSSQL Timestamp/Datetime to Unix Timestamp
    +1 Vote Up -0Vote Down

    Background Knowledge


    I will explain how to convert a DATETIME (data type) value in Microsoft SQL Server to Unix timestamp and how to convert Unix timestamp to DATETIME. A Unix timestamp is a integer value of seconds since January 1, 1970 at midnight. For further explanation of Unix timestamps refer to Wikiepedia, UnixTimestamp.com or http://unixtimesta.mp/.

    Note: This solution only work on dates prior to 2038-01-19 at 3:14:08 AM, where the delta in seconds exceeds the limit of the INT data type (integer is used as the result of DATEDIFF). See source for further details as I have not verified a solution to this problem.

    Solutions


    Convert Datetime Value to Unix Timestamp

      [Read more...]
    Example of a Basic ODBC (MSSQL Server) Query using PHP
    +0 Vote Up -4Vote Down

    An example of a basic ODBC (MSSQL Server/DSN-Less) query using PHP.

    Example of Result Set Returning One Row

    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    $szDBConn="DRIVER={SQL Server};SERVER=SQLServerNameHere;DATABASE=DatabaseNameHere";
    $szDBUsername="UsernameHere";
    $szDBPswd="PasswordHere";
    $szDBQuery="SELECT FooBar, Foo_Bar, Foo_ID FROM FoobarSubscribers WHERE FooID=777";
    $rDBConnect = odbc_connect($szDBConn, $szDBUsername, $szDBPswd);  
    $rDBRes = odbc_exec($rDBConnect, $szDBQuery);
    $szLastCheck = odbc_result($rDBRes, "LastCheck");
    odbc_free_result($rDBRes);
    odbc_close($rDBConnect);

    Example of Result Set Returning Multiple Rows in an Object

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    
    $szDBConn="DRIVER={SQL
      [Read more...]
    How To – Find The Version of Shockwave/Flash Player Installed
    +0 Vote Up -8Vote Down

    The following links load a flash file that will report what version is installed for Adobe Flash and Adobe Shockwave.

    Source: Version test for Adobe Flash Player

    Source: Test Adobe Shockwave & Flash Players

    How To – Change your ringtone on a Blackberry Curve
    +1 Vote Up -13Vote Down
  • Go to Profiles
  • Click on Advanced
  • Highlight Active profile
  • Click on Menu and select Edit
  • SMS Text/Phone/MMS etc.
  • Select Tone
  • Ring Tone: Change as desired
  • Volume: High/Medium/Low
  • Click back button
  • Select Save
  • How To – Resolve Adobe PDF Printer is Not Bound to Adobe PDF Port
    +0 Vote Up -0Vote Down

    Background Knowledge


    I have Windows Vista with Adobe Acrobat Professional v8.1.3 installed and I was trying to covert to Adobe PDF within Microsoft Publisher 2007.

    Error Message


    Acrobat PDFMaker reported the following error message dialog, “Adobe PDF Printer is not bound to Adobe PDF Port. Cannot proceed further. Kindly change the PDF Port to Adobe PDF Port in Adobe PDF Printer Settings”.

    Solution


  • Go to Control Panel -> Printers.
  • Right mouse click on “Adobe PDF” and left click on “Properties”.
  • Left mouse click on
  •   [Read more...]
    How To – Resolve Unable to Retrieve MSN Address Book using Pidgin
    +0 Vote Up -0Vote Down

    Background Knowledge


    Today (2008-01-12) I loaded Pidgin and discovered that I was no longer able to connect to MSN. It appears either Microsoft is blocking the connection or a new version has been release. What the cause of the matter is I have not been able to verify with certainty at this time.

    UPDATE: Pidgin v2.5.4 has been released that temporarily fixes the problem.

    Error Message


    “Unable to Retrieve MSN Address Book using Pidgin”. See screen shot of the error message below.

    Solution


  • Close Pidgin application.
  • Download and install “msn-pecan“.
  • Run Pidgin
  •   [Read more...]
    How To – Access Files on Windows from Mac OS X
    +0 Vote Up -0Vote Down

    Background Knowledge


    With the use of Samba we are able to share files through a local network and make it appear as if the files are on the Mac OS X locally. The instructions below will step you through step by step on how to access files from the Mac OS X to a Windows XP/Vista™ system through the network.

    NOTE: Instructions to unblock network traffic through a software/hardware firewall are not provided. Refer to your software/network manual or support web site for details.

    NOTE: These instructions will not allow for sharing via the Internet.

    Solution


    Setting up a file share in Windows XP

  • Open Windows Explorer/My Computer (press Windows Key+E) or go to the Windows Start Menu -> Programs -> Accessories -> Windows Explorer.
  • Browse to a
  •   [Read more...]
    How To - Remove Leading Zeros
    +0 Vote Up -0Vote Down

    Solutions

    Using PHP function intval().

    Code example: echo intval(”05″);
    Returned value: 5

    Using PHP function ltrim().

    Code example: echo ltrim(”005″,”0″);
    Returned value: 5

    ShareThis

    How To - Convert MySQL Timestamp/Datetime to Unix Timestamp
    +0 Vote Up -0Vote Down

    Background Knowledge


    Since MySQL v4.1 timestamp and datetime data types are formatted “YYYY-MM-DD HH:MM:SS”. Prior to MySQL v4.1 the timestamp was formatted as YYYYMMDDHHMMSS” and datetime formatted as “YYYY-MM-DD HH:MM:SS”. Refer to MySQL Reference Manual for further details.

    The Unix timestamp differs from MySQL. Unix’s timestamp is a integer value of seconds since January 1, 1970. For further explanation of Unix timestamps refer to Wikiepedia or UnixTimestamp.com.

    Solutions


    In MySQL you can use

      [Read more...]
    Showing entries 1 to 12

    Planet MySQL © 1995, 2013, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

    Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.