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 28

Displaying posts with tag: error (reset)

The network is reliable
+2 Vote Up -0Vote Down

A fascinating post-mortem on high profile network failures:

This post is meant as a reference point–to illustrate that, according to a wide range of accounts, partitions occur in many real-world environments. Processes, servers, NICs, switches, local and wide area networks can all fail, and the resulting economic consequences are real. Network outages can suddenly arise in systems that are stable for months at a time, during routine upgrades, or as a result of emergency maintenance. The consequences of these outages range from increased latency and temporary unavailability to inconsistency, corruption, and data loss. Split-brain is not an academic concern: it happens to all kinds of systems–sometimes for days on end. Partitions deserve serious consideration.

Diagnosing problems with SQL imports
+0 Vote Up -0Vote Down

Importing a text file containing a list of SQL commands into MySQL is a straightforward task. All you need to do is simply feed the file contents through pipe into MySQL command line client. For example: mysql app_production .

The reasons for doing such imports can be very different - restoring MySQL backups created with mysqldump, manually replaying binary log events or performing database migrations during software roll-outs.

While the task is simple, the import may not end successfully and when this happens, how to tell what the problem was?

MySQL errors

Whenever database hits an error, MySQL produces an error message that describes the problem and the import process stops immediately. If the message is not clear enough, you can always refer to the reported line number, which is the line number inside the source SQL file. This

  [Read more...]
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
+1 Vote Up -0Vote Down

This would have to be one of the most common MySQL error messages that is misleading to the end user developer. The MySQL Manual page confirms the broad range of possible conditions, but offers little to a PHP developer that does not speak MySQL Geek. I am commonly asked to help solve this issue from a developer.

The problem is that there are several conditions that can cause this error, and a more meaningful explanation to the end user would help in addressing the issue. In general terms, this actually means “Your SQL statement has failed because the connection to the database has been disconnected because of ???”.

Here are a few common situations and how to check for what “???” is.

1. Your MySQL server really did go away.

  [Read more...]
The hidden mistake
+5 Vote Up -0Vote Down

There are mistakes that drive you crazy when you try to understand what went wrong.

One of the most annoying and hard to catch was this, apparently harmless line:

tungsten-sandbox -m 5.5.24 --topology all-masters -n 2 -p 7300 -l 12300 -r 10300 –t $HOME/mm -d tsb-mm

The person reporting the error told me that the installation directory (indicated by "-t") was not taken into account.

I usually debug by examples, so I copied the line, and pasted it into one of my servers. Sure enough, the application did not take trat option into account. The installation kept happening in the default directory.

I knew that I had done a good job at making the application configurable, but I checked the code nonetheless. The only place where the default directory is mentioned is when the related variable is initialized. Throughout the code, there are no


  [Read more...]
A small rant on Galera & XtraDB Cluster
+3 Vote Up -0Vote Down

I had to install Percona XtraDB Cluster, I think for the first time since it was announced stable. I remembered many problems I faced with beta releases, which was understandable given they were only for a preview, but this time I hoped for significant improvements.

I have to say I am generally quite sensitive about simple problems that could/should be easily discovered and corrected. Well, it didn’t take five minutes to see a few of such problems. These minutes I spent installing the database binaries from Percona Yum repository. It turned out that was enough to see a lot of errors for no reason. Not a good thing.

[..]
  Installing : 1:Percona-XtraDB-Cluster-server-5.5.23-23.5.333.rhel6.x86_64         5/5
ls: cannot access /var/lib/mysql/*.err: No such file or directory
ls: cannot access /var/lib/mysql/*.err: No such file or directory
  [Read more...]
MySQL, OOM Killer, and everything related
+1 Vote Up -0Vote Down

Do the operating systems kill your MySQL instances from time to time? Are some database servers swapping constantly? These are relatively common problems. Why? How to prevent them?

Memory allocation

When a running program needs some additional memory, it can typically allocate it dynamically with malloc() function. It finds an unused continuous block that is at least as large as the requested size, reserves as much as it needs, and returns a pointer to that space. No initialization of the memory contents is performed at the time. When malloc() returns NULL instead of a valid address, it is an information to the calling program that there wasn’t enough memory available and the call has failed to allocate anything. In such cases applications typically take appropriate actions to notify users about the problem and terminate some of their

  [Read more...]
An elaborate way to break a MySQL server with XtraBackup
+2 Vote Up -0Vote Down

XtraBackup is a great piece of software from Percona, which allows creating (nearly) lock-less MySQL/InnoDB backups. The tool has been around for quite some time and recently even received a major version bump. I have relied on it many times over the years. As it turns out, using it in some configurations may lead to heavy swapping or prevent MySQL from running queries.

So far I only kept complaining about the wrapper script XtraBackup has been distributed with and which was taken from Oracle’s InnoDB Hot Backup. The infamous innobackupex-1.5.1 was neither well written, nor was it even fully compatible with the XtraBackup’s feature set. This sometimes led to weird problems where there should not be any.

This time the problem can appear elsewhere. Mostly when one using the tool does not understand how it works in

  [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...]

Running out of disk space on MySQL partition? A quick rescue.
+2 Vote Up -0Vote Down

No space left on device – this can happen to anyone. Sooner or later you may face the situation where a database either has already or is only minutes away from running out of disk space. What many people do in such cases, they just start looking for semi-random things to remove – perhaps a backup, a few older log files, or pretty much anything that seems redundant. However this means acting under a lot of stress and without much thinking, so it would be great if there was a possibility to avoid that. Often there is. Or what if there isn’t anything to remove?

While xfs is usually the recommended filesystem for a MySQL data partition on Linux, the extended filesystem family continues to be very popular as it is used as default in all major Linux distributions. There is a feature

  [Read more...]
Why a statement can be unsafe when it uses LIMIT clause?
+0 Vote Up -0Vote Down

MySQL 5.1 or newer can sometimes start throwing a strange message into an error log. The message states that a query was unsafe for binary logging along with some additional information. What does it mean? Is it a problem?

From time to time you might spot MySQL error log filling with the following warning:

“[Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Statement: DELETE FROM score WHERE user_id = 12345 AND created = ’2012-04-15′ LIMIT 1″

If binary logging is enabled and the log format is set to STATEMENT, MySQL generates such message when it considers that a query is ambiguous and could behave

  [Read more...]
Lost connection to MySQL server during query
+1 Vote Up -0Vote Down

When an application runs a query in MySQL, from time to time, it may receive various errors. Some are related to syntax errors in the query text itself, some occur because the statement attempted an illegal operation such as for example writing a duplicate value into a column with unique constraint. But there are a few that are not as easy to figure out, because they have no direct relationship with the actual work being done. One of such error messages reads “Lost connection to MySQL server during query”. What does it actually mean? If it appears frequently, how to diagnose what the problem may be?

The first thing to know about the “Lost connection to MySQL server during query” message is that this is not a MySQL error. It is a MySQL client error. The difference may seem subtle, but it is significant. A MySQL

  [Read more...]
MySQL 5.6 too verbose when creating data directory
+4 Vote Up -0Vote Down

When I install a MySQL package using MySQL Sandbox, if everything goes smoothly, I get an informative message on standard output, and I keep working.

This is OK


$HOME/opt/mysql/5.5.15/scripts/mysql_install_db --no-defaults \
--user=$USER --basedir=$HOME/opt/mysql/5.5.15 \
--datadir=$HOME/sandboxes/msb_5_5_15/data \
--lower_case_table_names=2
Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/Users/gmax/opt/mysql/5.5.15/bin/mysqladmin -u root password 'new-password'















  [Read more...]
Could not find first log file name in binary log index file
+2 Vote Up -4Vote Down

Scenario Master – Master replication

MasterA is a client facing server
MasterB is a warm standby server (read only)

MasterB restarted abruptly and when instances were braught back up MasterA (it’s slave) was showing the following error:

MasterA has the following error in show slave status:
Last_IO_Errno: 1236
Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: ‘Could not find first log file name in binary log index file’

Solution:

Slave: stop slave;

Master: flush logs
Master: show master status; — take note of the master log file and master log position

Slave: CHANGE MASTER TO MASTER_LOG_FILE=’log-bin.00000X′, MASTER_LOG_POS=106;
Slave: start slave;

MySQL ERROR 1137 (HY000): Can’t reopen table: ‘tmp_journals’
+0 Vote Up -0Vote Down

When setting up a query using a temporary lookup table, I got this error:

ERROR 1137 (HY000): Can't reopen table: 'tmp_journals'

It transpires that since 4.1 the way MySQL handles temporary tables has changed. This affects joins, unions and subqueries. There is an obvious fix:

mysql> CREATE TEMPORARY TABLE tmp_journals_2 LIKE tmp_journals;
Query OK, 0 rows affected (0.00 sec)

mysql> INSERT INTO tmp_journals_2 SELECT * FROM tmp_journals;
Query OK, 3228659 rows affected (2.01 sec)
Records: 3228659  Duplicates: 0  Warnings: 0 

Then the query is easy:

SELECT COUNT(1) cnt, journal_invoice_ref
FROM tmp_journals
GROUP BY journal_date 
HAVING cnt > 10000</pre>

UNION

SELECT COUNT(1) cnt, journal_invoice_ref
FROM tmp_journals_2
GROUP BY journal_invoice_ref
HAVING cnt < 10

Kontrollbase reporter XML Parser error has been fixed
+0 Vote Up -0Vote Down
If you have seen the following error on the Perf Report tab “Message: SimpleXMLElement::__construct()…” – it has been fixed in revision 281. This only affects alerts 11 and 12 so you might not run into it immediately. The solution is to either remove lines “586, 590, 639, 650″ from the bin/kontroll-reporter-5.0.x_linux-x86-2.0.1.pl file, or to run [...]
How To Fix Intermittent MySQL Errcode 13 Errors On Windows
+4 Vote Up -0Vote Down

The Problem

I've had MySQL on my Windows 7 laptop for a bit (as part of wampserver), mostly for local offline WordPress development.

However, even though MySQL is relatively stable, I've been observing a vast quantity of intermittent MySQL errors, as reported by WordPress in the PHP error log (C:\wamp\logs\php_error.log). Here are some examples:

[05-Jan-2010 09:47:51] WordPress database error Error on delete of
'C:\Windows\TEMP\#sql17e0_1a2_6.MYD' (Errcode: 13) for query SELECT t.*, tt.*
FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id
INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id =
tt.term_taxonomy_id WHERE tt.taxonomy IN
  [Read more...]
MySQL Error: error reconnecting to master
+1 Vote Up -0Vote Down
Error message:Slave I/O thread: error reconnecting to masterLast_IO_Error: error connecting to masterDiagnosis:Check that the slave can connect to the master instance, using the following steps:Use ping to check the master is reachable. eg ping master.yourdomain.comUse ping with ip address to check that DNS isn't broken. eg. ping 192.168.1.2Use mysql client to connect from slave to master. eg
MySQL Error: error reconnecting to master
+0 Vote Up -0Vote Down

Error message:

Slave I/O thread: error reconnecting to master
Last_IO_Error: error connecting to master

Diagnosis:

Check that the slave can connect to the master instance, using the following steps:

  • Use ping to check the master is reachable. eg ping master.yourdomain.com
  • Use ping with ip address to check that DNS isn’t broken. eg. ping 192.168.1.2
  • Use mysql client to connect from slave to master. eg mysql -u repluser -pREPLPASS –host=master.yourdomain.com –port=3306 (substitute whatever port you are connecting to the master on)
  • If all steps work, then check that the repluser (the SLAVE replication user has the REPLICATION SLAVE privilege). eg. show grants for ‘repl’@’slave.yourdomain.com’;
  • Resolution:

    • If step 1 and 2 fail, you have a network or firewall

      [Read more...]
    Kontrollbase rev51 – code fix for model_main.php
    +0 Vote Up -0Vote Down

    Came across an error on the sql for the overview.php page. It wasn’t correctly displaying aggregate data on the charts. So here’s the fix for rev50 to rev51. This isn’t a deal breaker on the release but if you’re inclined to open system/application/models/model_main.php and replace one line it’s easier than waiting for our next release.

    2001c2001
    ---
    > $sql = "select max($xval) as $xval,DATE_FORMAT(Creation_time,'%m-%d %H:%i') as Date from server_statistics WHERE Creation_time BETWEEN '$sday' AND '$eday' GROUP BY DAY(Creation_time),HOUR(Creation_time) ORDER BY Creation_time";

    More IE7 fixes – header.php
    +0 Vote Up -0Vote Down

    Fixed a lingering JS issue with the ExtJS code in header.php file that was preventing IE7 from loading the main.php page. It was….. an extra comma! If you are inclined to edit one file here is the diff change, otherwise like other bug fixes it will be included with the next release. The file is system/application/views/header.php and the change is for line #327 for revision 42+.

    ---
    > {id: 'innodb_total', header: "innodb_total", width: 75, sortable: true, renderer: 'fileSize', dataIndex: 'innodb_total'}

    Kontrollbase – IE7 login error fixed
    +0 Vote Up -0Vote Down

    If you run IE7 and have tried Kontrollbase you may have noticed an infinite progress bar for the authentication. While login works on all other browsers, it was broken on IE7. The change has been committed to the repo and will be available in the next release. If you are inclined to edit one file here is the diff change. The file is system/application/controllers/login.php and the change is for line #68.

    68c68
    session->userdata('user_system_user_id');
    ---
    > $user_system_user_id = $this->phpsession->get('user_system_user_id');

    A deceiving error message while setting a replication slave
    +0 Vote Up -0Vote Down
    I was setting up a slave manually for a quick-and-dirty experiment, when I found this one:

    mysql %gt; slave start;
    ERROR 1200 (HY000): The server is not configured as slave; fix in config file or with CHANGE MASTER TO

    Hmm... I did the CHANGE MASTER TO already, but just for the sake of it, let's do it again.

    mysql %gt; change master to master_host='127.0.0.1', master_port=22346,
    master_user='msandbox', master_password='msandbox',
    master_log_file='mysql-bin.000002', master_log_pos=106;
    Query OK, 0 rows affected (0.00 sec)

    mysql %gt; slave start;
    ERROR 1200 (HY000): The server is not configured as slave; fix in config file or with CHANGE MASTER TO

    Again! Why is it asking to execute CHANGE MASTER TO, which has been accepted right now?
















      [Read more...]
    SeaTools for DOS v1.0PH – Overtemp–253
    +0 Vote Up -0Vote Down

    I was running a hard drive diagnostic using SeaTools for DOS v1.09PH on two exactly the same Maxtor hard drives, see details of the drives below. When I attempted to run a quick scan and then a long scan it received a warning “Overtemp–253″. After doing some research I have come to the conclusion that with certainty that this doesn’t mean the hard drive is running at 253 degrees Fahrenheit. My two drives are well ventilated and do not even feel warm to the touch. In fact this message apparently means according to Seagate that the hard drive does not support SeaTools reading temperatures.

    • Brand: Maxtor
    • Model: 6Y060L0
    • FW: YAR41BW0

    Source: Incorrect temperature values for a Maxtor disk

    An Interesting Replication Tip
    +0 Vote Up -0Vote Down
    We recently moved some databases to different servers, and I altered our mySQL slave configuration files to take into account some of the databases we wanted to replicate (Replicate-do-db) and others that we wanted to ignore (Replicate-ignore-db) -- each of these server cases were mutually exclusive.All went well, until I found a peculiar error:Error 'Table 'db101.table101' doesn't exist' on
    Oracle is Not Compatible with Oracle
    +0 Vote Up -0Vote Down
    Just a short blog entry about a funny error message I’ve got while trying to activate a physical standby database: SQL> alter database recover managed standby database finish skip standby logfile; alter database recover managed standby database finish skip standby logfile * ERROR at line 1: ORA-00283: recovery session canceled due to errors ORA-01110: data file 1: '/oradata/stage/datafile/system_01.dbf' ORA-01122: database file 1 [...]
    PHP Calendar Functions Error
    +0 Vote Up -0Vote Down

    I was trying to use the PHP calendar API and immediately received this error message, “Fatal error: Call to undefined function cal_days_in_month()”. This error message means PHP was not compiled with the calendar extension.

    Solution


    The only solution to this error message and other similar error messages relating to the PHP calendar API requires PHP to be compiled with the calendar extension by adding “–enable-calendar” to the “configure command” as stated in the PHP documentation on the Calendar functions page.

    How to Tell if the Calendar Extension is Installed


    You can verify weather or not the PHP Calendar extension was compiled at install by using the phpinfo() function. When viewing the output of phpinfo() look under “Configure

      [Read more...]
    Stupid PHP Error
    +0 Vote Up -0Vote Down

    Dear Future self,

    The next time you run into PHP Fatal error: Call to undefined method DB_Error::query() and you are pretty sure all the correct libraries are installed , check if you can connect to the database with the username / password you have configured. Just as today you might have migrated to a new mysql server and forgotten to update the connection string.

    thank you for your attention.

    The invisible I/O thread failures are no more
    Employee +0 Vote Up -0Vote Down
    To get the status of the replication slave, it is possible to check the Last_Error and Last_Errno fields from SHOW SLAVE STATUS. Unfortunately, they only give information about the status of the SQL thread (and not always that either). If the I/O thread fails, for example, because the server configuration is not correctly set up, or if the connection to the master is lost due to a network outage, it is necessary to dig through the error log to find out the reason. This might be possible, although annoying, for a DBA to do since he has access to the files on the machine where the server is running, but when using automatic recovery applications that watch the status of the replication, this is not practical. It is also easier to see the status  [Read more...]
    Showing entries 1 to 28

    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.