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 18

Displaying posts with tag: How Tos (reset)

Resolving Error 1918, System Error Code 126, When Installing MySQL ODBC Driver
+0 Vote Up -0Vote Down

If you are installing MySQL ODBC Driver and encounter the following error:

Error 1918. Error installing ODBC driver MySQL ODBC 5.1 Driver, 
ODBC error 13: The setup routines for the MySQL ODBC 5.1 Driver 
could not be loaded due to system error code 126: 
The specified module could not be found. 
...\myodbc5S.dll).. Verify...

Then you will need to install the Microsoft Visual C++ 2010 Redistributable Package (select the appropriate one for your OS architecture below):

64-bit version:

read more

Improve your Stored Procedure Error Handling with GET DIAGNOSTICS
+0 Vote Up -0Vote Down

In a previous post, I discussed debugging stored procedures with RESIGNAL, which is of great value when troubleshooting errors raised by your stored procedures, functions, triggers, and events as of MySQL/MariaDB 5.5.

However, as of MySQL 5.6 and MariaDB 10.0, there is GET DIAGNOSTICS, which can be used to get the exact error details as well.

RESIGNAL just outputs the error, as it comes from the server, for instance:

ERROR 1146 (42S02): Table 'db1.t1' doesn't exist

read more

Quickly Debugging Stored Procedures, Functions, Triggers, and Events with RESIGNAL
+0 Vote Up -0Vote Down

I was recently debugging a stored procedure and could not easily identify the underlying reason for why it was failing.

It had a standard exit handler catch-all for SQLEXCEPTION, which was:

DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
SELECT ...;
END;

When there was an error, it didn't really output anything useful.

As of MySQL 5.5, there is RESIGNAL:

"RESIGNAL passes on the error condition information that is available during execution of a condition handler within a compound statement inside a stored procedure or function, trigger, or event."

read more

Google Docs sharing and its cloudy usability
+0 Vote Up -0Vote Down

Background: SkySQL is a distributed company. Nearly all of us work from home. To be productive, we need to emulate the best aspects of collaborating as if we were working next to one another. Given that nearly all of us had worked under similar distributed conditions at MySQL AB, we knew what we were getting into when we were founded. Obviously, we wanted to learn from our past experiences when making our choices for tools and processes.

read more

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...]
    MySQL 5.5 Defaults may pose Performance Issues
    +0 Vote Up -0Vote Down

    We have seen a few instances where upgrades of MySQL 5.1 to 5.5 have resulted in poor performance when using default values. After investigation it would appear that the main culprit appears to be the innodb_thread_concurrency setting.

    In MySQL 5.1 the default was 8, while in MySQL 5.5, the default was changed to 0 (unlimited).

    So what does innodb_thread_concurrency do and why would it cause performance issues?

    The value given to innodb_thread_concurrency sets the number of simultaneous threads the InnoDB engine will create.  If there are more jobs waiting to be processed than there are available thread slots, these jobs will be made to wait until a thread slot becomes free.  So on the face of it, making this unlimited sounds like a good idea - so you won't have any jobs waiting on thread slots.

    In an ideal world,

      [Read more...]
    Client requested master to start replication from impossible position
    +0 Vote Up -0Vote Down

    If you run a replicated MySQL setup and have a master failure, you may see the following error in your error log.

    [ERROR] Error reading packet from server: Client requested master to start replication from impossible position ( server_errno=1236)
    

    At this point your slave will not be replicating and you will need to recover from the situation. But why did it occur in the first place and what does it mean to your data integrity?

    Why it occurs

    This error will occur if the master stops unexpectedly. This could be as a result of a hardware failure (like a disk error) or a power loss.  Any time this happens there is a chain of events that result in the problem.

    First of all MySQL holds a lot of information in memory.  Even with InnoDB there may be a pending transaction that has not yet written to

      [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 18

    Planet MySQL © 1995, 2014, 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.