Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > main-testing > by-pkgid > b1e2421f2416edfc24c5845fbc1c5a2e > files > 7

mysql-doc-5.0.51a-8mdv2008.1.x86_64.rpm

<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Appendix B. Errors, Error Codes, and Common Problems</title><link rel="stylesheet" href="mysql-html.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.69.1"><link rel="start" href="index.html" title="MySQL 5.0 Reference Manual"><link rel="up" href="index.html" title="MySQL 5.0 Reference Manual"><link rel="prev" href="faqs.html" title="Appendix A. MySQL 5.0 Frequently Asked Questions"><link rel="next" href="releasenotes-es.html" title="Appendix C. MySQL Enterprise Release Notes"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix B. Errors, Error Codes, and Common Problems</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="faqs.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="releasenotes-es.html">Next</a></td></tr></table><hr></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="error-handling"></a>Appendix B. Errors, Error Codes, and Common Problems</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="error-handling.html#problems">B.1. Problems and Common Errors</a></span></dt><dd><dl><dt><span class="section"><a href="error-handling.html#what-is-crashing">B.1.1. How to Determine What Is Causing a Problem</a></span></dt><dt><span class="section"><a href="error-handling.html#common-errors">B.1.2. Common Errors When Using MySQL Programs</a></span></dt><dt><span class="section"><a href="error-handling.html#installation-issues">B.1.3. Installation-Related Issues</a></span></dt><dt><span class="section"><a href="error-handling.html#administration-issues">B.1.4. Administration-Related Issues</a></span></dt><dt><span class="section"><a href="error-handling.html#query-issues">B.1.5. Query-Related Issues</a></span></dt><dt><span class="section"><a href="error-handling.html#optimizer-issues">B.1.6. Optimizer-Related Issues</a></span></dt><dt><span class="section"><a href="error-handling.html#table-definition-issues">B.1.7. Table Definition-Related Issues</a></span></dt><dt><span class="section"><a href="error-handling.html#bugs">B.1.8. Known Issues in MySQL</a></span></dt></dl></dd><dt><span class="section"><a href="error-handling.html#error-messages-server">B.2. Server Error Codes and Messages</a></span></dt><dt><span class="section"><a href="error-handling.html#error-messages-client">B.3. Client Error Codes and Messages</a></span></dt></dl></div><p>
    This appendix lists common problems and errors that may occur and
    potential resolutions, in addition to listing the errors that may
    appear when you call MySQL from any host language. The first section
    covers problems and resolutions. Detailed information on errors is
    provided; The first list displays server error messages. The second
    list displays client program messages.
  </p><p class="mnmas"><b>MySQL Enterprise</b>
      The MySQL Enterprise Monitor provides a “<span class="quote">Virtual DBA</span>”
      to assist with problem solving. For more information, see
      <a href="http://www.mysql.com/products/enterprise/advisors.html" target="_top">http://www.mysql.com/products/enterprise/advisors.html</a>.
    </p><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="problems"></a>B.1. Problems and Common Errors</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="error-handling.html#what-is-crashing">B.1.1. How to Determine What Is Causing a Problem</a></span></dt><dt><span class="section"><a href="error-handling.html#common-errors">B.1.2. Common Errors When Using MySQL Programs</a></span></dt><dt><span class="section"><a href="error-handling.html#installation-issues">B.1.3. Installation-Related Issues</a></span></dt><dt><span class="section"><a href="error-handling.html#administration-issues">B.1.4. Administration-Related Issues</a></span></dt><dt><span class="section"><a href="error-handling.html#query-issues">B.1.5. Query-Related Issues</a></span></dt><dt><span class="section"><a href="error-handling.html#optimizer-issues">B.1.6. Optimizer-Related Issues</a></span></dt><dt><span class="section"><a href="error-handling.html#table-definition-issues">B.1.7. Table Definition-Related Issues</a></span></dt><dt><span class="section"><a href="error-handling.html#bugs">B.1.8. Known Issues in MySQL</a></span></dt></dl></div><a class="indexterm" name="id3176354"></a><a class="indexterm" name="id3176367"></a><p>
      This section lists some common problems and error messages that
      you may encounter. It describes how to determine the causes of the
      problems and what to do to solve them.
    </p><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="what-is-crashing"></a>B.1.1. How to Determine What Is Causing a Problem</h3></div></div></div><p>
        When you run into a problem, the first thing you should do is to
        find out which program or piece of equipment is causing it:
      </p><div class="itemizedlist"><ul type="disc"><li><p>
            If you have one of the following symptoms, then it is
            probably a hardware problems (such as memory, motherboard,
            CPU, or hard disk) or kernel problem:
          </p><div class="itemizedlist"><ul type="circle"><li><p>
                The keyboard doesn't work. This can normally be checked
                by pressing the Caps Lock key. If the Caps Lock light
                doesn't change, you have to replace your keyboard.
                (Before doing this, you should try to restart your
                computer and check all cables to the keyboard.)
              </p></li><li><p>
                The mouse pointer doesn't move.
              </p></li><li><p>
                The machine doesn't answer to a remote machine's pings.
              </p></li><li><p>
                Other programs that are not related to MySQL don't
                behave correctly.
              </p></li><li><p>
                Your system restarted unexpectedly. (A faulty user-level
                program should never be able to take down your system.)
              </p></li></ul></div><p>
            In this case, you should start by checking all your cables
            and run some diagnostic tool to check your hardware! You
            should also check whether there are any patches, updates, or
            service packs for your operating system that could likely
            solve your problem. Check also that all your libraries (such
            as <code class="literal">glibc</code>) are up to date.
          </p><p>
            It's always good to use a machine with ECC memory to
            discover memory problems early.
          </p></li><li><p>
            If your keyboard is locked up, you may be able to recover by
            logging in to your machine from another machine and
            executing <code class="literal">kbd_mode -a</code>.
          </p></li><li><p>
            Please examine your system log file
            (<code class="filename">/var/log/messages</code> or similar) for
            reasons for your problem. If you think the problem is in
            MySQL, you should also examine MySQL's log files. See
            <a href="server-administration.html#log-files" title="5.10. MySQL Server Logs">Section 5.10, “MySQL Server Logs”</a>.
          </p></li><li><p>
            If you don't think you have hardware problems, you should
            try to find out which program is causing problems. Try using
            <span><strong class="command">top</strong></span>, <span><strong class="command">ps</strong></span>, Task Manager,
            or some similar program, to check which program is taking
            all CPU or is locking the machine.
          </p></li><li><p>
            Use <span><strong class="command">top</strong></span>, <span><strong class="command">df</strong></span>, or a
            similar program to check whether you are out of memory, disk
            space, file descriptors, or some other critical resource.
          </p></li><li><p>
            If the problem is some runaway process, you can always try
            to kill it. If it doesn't want to die, there is probably a
            bug in the operating system.
          </p></li></ul></div><p>
        If after you have examined all other possibilities and you have
        concluded that the MySQL server or a MySQL client is causing the
        problem, it's time to create a bug report for our mailing list
        or our support team. In the bug report, try to give a very
        detailed description of how the system is behaving and what you
        think is happening. You should also state why you think that
        MySQL is causing the problem. Take into consideration all the
        situations in this chapter. State any problems exactly how they
        appear when you examine your system. Use the “<span class="quote">copy and
        paste</span>” method for any output and error messages from
        programs and log files.
      </p><p>
        Try to describe in detail which program is not working and all
        symptoms you see. We have in the past received many bug reports
        that state only “<span class="quote">the system doesn't work.</span>” This
        doesn't provide us with any information about what could be the
        problem.
      </p><p>
        If a program fails, it's always useful to know the following
        information:
      </p><div class="itemizedlist"><ul type="disc"><li><p>
            Has the program in question made a segmentation fault (did
            it dump core)?
          </p></li><li><p>
            Is the program taking up all available CPU time? Check with
            <span><strong class="command">top</strong></span>. Let the program run for a while, it
            may simply be evaluating something computationally
            intensive.
          </p></li><li><p>
            If the <span><strong class="command">mysqld</strong></span> server is causing problems,
            can you get any response from it with <span><strong class="command">mysqladmin -u
            root ping</strong></span> or <span><strong class="command">mysqladmin -u root
            processlist</strong></span>?
          </p></li><li><p>
            What does a client program say when you try to connect to
            the MySQL server? (Try with <span><strong class="command">mysql</strong></span>, for
            example.) Does the client jam? Do you get any output from
            the program?
          </p></li></ul></div><p>
        When sending a bug report, you should follow the outline
        described in <a href="introduction.html#bug-reports" title="1.7. How to Report Bugs or Problems">Section 1.7, “How to Report Bugs or Problems”</a>.
      </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="common-errors"></a>B.1.2. Common Errors When Using MySQL Programs</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="error-handling.html#error-access-denied">B.1.2.1. <code class="literal">Access denied</code></a></span></dt><dt><span class="section"><a href="error-handling.html#can-not-connect-to-server">B.1.2.2. <code class="literal">Can't connect to [local] MySQL server</code></a></span></dt><dt><span class="section"><a href="error-handling.html#error-lost-connection">B.1.2.3. <code class="literal">Lost connection to MySQL server</code></a></span></dt><dt><span class="section"><a href="error-handling.html#old-client">B.1.2.4. <code class="literal">Client does not support authentication protocol</code></a></span></dt><dt><span class="section"><a href="error-handling.html#password-too-long">B.1.2.5. Password Fails When Entered Interactively</a></span></dt><dt><span class="section"><a href="error-handling.html#blocked-host">B.1.2.6. <code class="literal">Host '<em class="replaceable"><code>host_name</code></em>' is
          blocked</code></a></span></dt><dt><span class="section"><a href="error-handling.html#too-many-connections">B.1.2.7. <code class="literal">Too many connections</code></a></span></dt><dt><span class="section"><a href="error-handling.html#out-of-memory">B.1.2.8. <code class="literal">Out of memory</code></a></span></dt><dt><span class="section"><a href="error-handling.html#gone-away">B.1.2.9. <code class="literal">MySQL server has gone away</code></a></span></dt><dt><span class="section"><a href="error-handling.html#packet-too-large">B.1.2.10. <code class="literal">Packet too large</code></a></span></dt><dt><span class="section"><a href="error-handling.html#communication-errors">B.1.2.11. Communication Errors and Aborted Connections</a></span></dt><dt><span class="section"><a href="error-handling.html#full-table">B.1.2.12. <code class="literal">The table is full</code></a></span></dt><dt><span class="section"><a href="error-handling.html#cannot-create">B.1.2.13. <code class="literal">Can't create/write to file</code></a></span></dt><dt><span class="section"><a href="error-handling.html#commands-out-of-sync">B.1.2.14. <code class="literal">Commands out of sync</code></a></span></dt><dt><span class="section"><a href="error-handling.html#ignoring-user">B.1.2.15. <code class="literal">Ignoring user</code></a></span></dt><dt><span class="section"><a href="error-handling.html#cannot-find-table">B.1.2.16. <code class="literal">Table '<em class="replaceable"><code>tbl_name</code></em>' doesn't
          exist</code></a></span></dt><dt><span class="section"><a href="error-handling.html#cannot-initialize-character-set">B.1.2.17. <code class="literal">Can't initialize character set</code></a></span></dt><dt><span class="section"><a href="error-handling.html#not-enough-file-handles">B.1.2.18. <span class="errortext">'<em class="replaceable"><code>File</code></em>' Not Found</span> and
          Similar Errors</a></span></dt></dl></div><a class="indexterm" name="id3176699"></a><p>
        This section lists some errors that users frequently encounter
        when running MySQL programs. Although the problems show up when
        you try to run client programs, the solutions to many of the
        problems involves changing the configuration of the MySQL
        server.
      </p><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="error-access-denied"></a>B.1.2.1. <code class="literal">Access denied</code></h4></div></div></div><a class="indexterm" name="id3176731"></a><a class="indexterm" name="id3176744"></a><a class="indexterm" name="id3176757"></a><p>
          An <code class="literal">Access denied</code> error can have many
          causes. Often the problem is related to the MySQL accounts
          that the server allows client programs to use when connecting.
          See <a href="server-administration.html#access-denied" title="5.7.8. Causes of Access denied Errors">Section 5.7.8, “Causes of <code class="literal">Access denied</code> Errors”</a>, and
          <a href="server-administration.html#privileges" title="5.7.2. How the Privilege System Works">Section 5.7.2, “How the Privilege System Works”</a>.
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="can-not-connect-to-server"></a>B.1.2.2. <code class="literal">Can't connect to [local] MySQL server</code></h4></div></div></div><div class="toc"><dl><dt><span class="section"><a href="error-handling.html#can-not-connect-to-server-on-windows">B.1.2.2.1. <code class="literal">Connection to MySQL Server Failing on Windows</code></a></span></dt></dl></div><p>
          A MySQL client on Unix can connect to the
          <span><strong class="command">mysqld</strong></span> server in two different ways: By
          using a Unix socket file to connect through a file in the
          filesystem (default <code class="filename">/tmp/mysql.sock</code>), or
          by using TCP/IP, which connects through a port number. A Unix
          socket file connection is faster than TCP/IP, but can be used
          only when connecting to a server on the same computer. A Unix
          socket file is used if you don't specify a hostname or if you
          specify the special hostname <code class="literal">localhost</code>.
        </p><p>
          If the MySQL server is running on Windows, you can connect via
          TCP/IP. If the server is started with the
          <code class="option">--enable-named-pipe</code> option, you can also
          connect with named pipes if you run the client on the host
          where the server is running. The name of the named pipe is
          <code class="literal">MySQL</code> by default. If you don't give a
          hostname when connecting to <span><strong class="command">mysqld</strong></span>, a MySQL
          client first tries to connect to the named pipe. If that
          doesn't work, it connects to the TCP/IP port. You can force
          the use of named pipes on Windows by using
          <code class="literal">.</code> as the hostname.
        </p><p>
          The error (2002) <code class="literal">Can't connect to ...</code>
          normally means that there is no MySQL server running on the
          system or that you are using an incorrect Unix socket filename
          or TCP/IP port number when trying to connect to the server.
        </p><p>
          The error (2003) <code class="literal">Can't connect to MySQL server on
          '<em class="replaceable"><code>server</code></em>' (10061)</code>
          indicates that the network connection has been refused. You
          should check that there is a MySQL server running, that it has
          network connections enabled, the network port you specified is
          the one configured on the server, and that the TCP/IP port you
          are using has not been blocked by a firewall or port blocking
          service.
        </p><p>
          Start by checking whether there is a process named
          <span><strong class="command">mysqld</strong></span> running on your server host. (Use
          <span><strong class="command">ps xa | grep mysqld</strong></span> on Unix or the Task
          Manager on Windows.) If there is no such process, you should
          start the server. See <a href="installing.html#starting-server" title="2.4.16.2.3. Starting and Troubleshooting the MySQL Server">Section 2.4.16.2.3, “Starting and Troubleshooting the MySQL Server”</a>.
        </p><p>
          If a <span><strong class="command">mysqld</strong></span> process is running, you can
          check it by trying the following commands. The port number or
          Unix socket filename might be different in your setup.
          <code class="literal">host_ip</code> represents the IP number of the
          machine where the server is running.
        </p><pre class="programlisting">shell&gt; <strong class="userinput"><code>mysqladmin version</code></strong>
shell&gt; <strong class="userinput"><code>mysqladmin variables</code></strong>
shell&gt; <strong class="userinput"><code>mysqladmin -h `hostname` version variables</code></strong>
shell&gt; <strong class="userinput"><code>mysqladmin -h `hostname` --port=3306 version</code></strong>
shell&gt; <strong class="userinput"><code>mysqladmin -h host_ip version</code></strong>
shell&gt; <strong class="userinput"><code>mysqladmin --protocol=socket --socket=/tmp/mysql.sock version</code></strong>
</pre><p>
          Note the use of backticks rather than forward quotes with the
          <code class="literal">hostname</code> command; these cause the output of
          <code class="literal">hostname</code> (that is, the current hostname) to
          be substituted into the <span><strong class="command">mysqladmin</strong></span> command.
          If you have no <code class="literal">hostname</code> command or are
          running on Windows, you can manually type the hostname of your
          machine (without backticks) following the
          <code class="literal">-h</code> option. You can also try <code class="literal">-h
          127.0.0.1</code> to connect with TCP/IP to the local host.
        </p><p>
          Here are some reasons the <code class="literal">Can't connect to local
          MySQL server</code> error might occur:
        </p><div class="itemizedlist"><ul type="disc"><li><p>
              <span><strong class="command">mysqld</strong></span> is not running. Check your
              operating system's process list to ensure the
              <span><strong class="command">mysqld</strong></span> process is present.
            </p></li><li><p>
              You're running a MySQL server on Windows with many TCP/IP
              connections to it. If you're experiencing that quite often
              your clients get that error, you can find a workaround
              here:
              <a href="error-handling.html#can-not-connect-to-server-on-windows" title="B.1.2.2.1. Connection to MySQL Server Failing on Windows">Section B.1.2.2.1, “<code class="literal">Connection to MySQL Server Failing on Windows</code>”</a>.
            </p></li><li><p>
              You are running on a system that uses MIT-pthreads. If you
              are running on a system that doesn't have native threads,
              <span><strong class="command">mysqld</strong></span> uses the MIT-pthreads package.
              See <a href="installing.html#which-os" title="2.4.2. Operating Systems Supported by MySQL Community Server">Section 2.4.2, “Operating Systems Supported by MySQL Community Server”</a>. However, not all
              MIT-pthreads versions support Unix socket files. On a
              system without socket file support, you must always
              specify the hostname explicitly when connecting to the
              server. Try using this command to check the connection to
              the server:
            </p><pre class="programlisting">shell&gt; <strong class="userinput"><code>mysqladmin -h `hostname` version</code></strong>
</pre></li><li><p>
              Someone has removed the Unix socket file that
              <span><strong class="command">mysqld</strong></span> uses
              (<code class="filename">/tmp/mysql.sock</code> by default). For
              example, you might have a <span><strong class="command">cron</strong></span> job that
              removes old files from the <code class="filename">/tmp</code>
              directory. You can always run <span><strong class="command">mysqladmin
              version</strong></span> to check whether the Unix socket file
              that <span><strong class="command">mysqladmin</strong></span> is trying to use really
              exists. The fix in this case is to change the
              <span><strong class="command">cron</strong></span> job to not remove
              <code class="filename">mysql.sock</code> or to place the socket
              file somewhere else. See
              <a href="error-handling.html#problems-with-mysql-sock" title="B.1.4.5. How to Protect or Change the MySQL Unix Socket File">Section B.1.4.5, “How to Protect or Change the MySQL Unix Socket File”</a>.
            </p></li><li><p>
              You have started the <span><strong class="command">mysqld</strong></span> server with
              the <code class="option">--socket=/path/to/socket</code> option, but
              forgotten to tell client programs the new name of the
              socket file. If you change the socket pathname for the
              server, you must also notify the MySQL clients. You can do
              this by providing the same <code class="option">--socket</code>
              option when you run client programs. You also need to
              ensure that clients have permission to access the
              <code class="filename">mysql.sock</code> file. To find out where
              the socket file is, you can do:
            </p><pre class="programlisting">shell&gt; <strong class="userinput"><code>netstat -ln | grep mysql</code></strong>
</pre><p>
              See <a href="error-handling.html#problems-with-mysql-sock" title="B.1.4.5. How to Protect or Change the MySQL Unix Socket File">Section B.1.4.5, “How to Protect or Change the MySQL Unix Socket File”</a>.
            </p></li><li><p>
              You are using Linux and one server thread has died (dumped
              core). In this case, you must kill the other
              <span><strong class="command">mysqld</strong></span> threads (for example, with
              <span><strong class="command">kill</strong></span> or with the
              <span><strong class="command">mysql_zap</strong></span> script) before you can
              restart the MySQL server. See <a href="error-handling.html#crashing" title="B.1.4.2. What to Do If MySQL Keeps Crashing">Section B.1.4.2, “What to Do If MySQL Keeps Crashing”</a>.
            </p></li><li><p>
              The server or client program might not have the proper
              access privileges for the directory that holds the Unix
              socket file or the socket file itself. In this case, you
              must either change the access privileges for the directory
              or socket file so that the server and clients can access
              them, or restart <span><strong class="command">mysqld</strong></span> with a
              <code class="option">--socket</code> option that specifies a socket
              filename in a directory where the server can create it and
              where client programs can access it.
            </p></li></ul></div><p>
          If you get the error message <code class="literal">Can't connect to MySQL
          server on some_host</code>, you can try the following
          things to find out what the problem is:
        </p><div class="itemizedlist"><ul type="disc"><li><p>
              Check whether the server is running on that host by
              executing <code class="literal">telnet some_host 3306</code> and
              pressing the Enter key a couple of times. (3306 is the
              default MySQL port number. Change the value if your server
              is listening to a different port.) If there is a MySQL
              server running and listening to the port, you should get a
              response that includes the server's version number. If you
              get an error such as <code class="literal">telnet: Unable to connect to
              remote host: Connection refused</code>, then there is
              no server running on the given port.
            </p></li><li><p>
              If the server is running on the local host, try using
              <span><strong class="command">mysqladmin -h localhost variables</strong></span> to
              connect using the Unix socket file. Verify the TCP/IP port
              number that the server is configured to listen to (it is
              the value of the <code class="literal">port</code> variable.)
            </p></li><li><p>
              Make sure that your <span><strong class="command">mysqld</strong></span> server was
              not started with the <code class="option">--skip-networking</code>
              option. If it was, you cannot connect to it using TCP/IP.
            </p></li><li><p>
              Check to make sure that there is no firewall blocking
              access to MySQL. Your firewall may be configured on the
              basis of the application being executed, or the post
              number used by MySQL for communication (3306 by default).
            </p><p>
              Under Linux or Unix, check your IP tables (or similar)
              configuration to ensure that the port has not been
              blocked.
            </p><p>
              Under Windows, applications such as ZoneAlarm and the
              Windows XP personal firewall may need to be configured to
              allow external access to a MySQL server.
            </p></li><li><p>
              If you are running under Linux and Security-Enhanced Linux
              (SELinux) is enabled, make sure you have disabled SELinux
              protection for the <code class="literal">mysqld</code> process.
            </p></li></ul></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="can-not-connect-to-server-on-windows"></a>B.1.2.2.1. <code class="literal">Connection to MySQL Server Failing on Windows</code></h5></div></div></div><p>
            When you're running a MySQL server on Windows with many
            TCP/IP connections to it, and you're experiencing that quite
            often your clients get a <code class="literal">Can't connect to MySQL
            server</code> error, the reason might be that Windows
            doesn't allow for enough ephemeral (short-lived) ports to
            serve those connections.
          </p><p>
            By default, Windows allows 5000 ephemeral (short-lived) TCP
            ports to the user. After any port is closed it will remain
            in a <code class="literal">TIME_WAIT</code> status for 120 seconds.
            This status allows the connection to be reused at a much
            lower cost than reinitializing a brand new connection.
            However, the port will not be available again until this
            time expires.
          </p><p>
            With a small stack of available TCP ports (5000) and a high
            number of TCP ports being open and closed over a short
            period of time along with the <code class="literal">TIME_WAIT</code>
            status you have a good chance for running out of ports.
            There are two ways to address this problem:
          </p><div class="itemizedlist"><ul type="disc"><li><p>
                Reduce the number of TCP ports consumed quickly by
                investigating connection pooling or persistent
                connections where possible
              </p></li><li><p>
                Tune some settings in the Windows registry (see below)
              </p></li></ul></div><p>
            <span class="bold"><strong> IMPORTANT: The following procedure
            involves modifying the Windows registry. Before you modify
            the registry, make sure to back it up and make sure that you
            understand how to restore the registry if a problem occurs.
            For information about how to back up, restore, and edit the
            registry, view the following article in the Microsoft
            Knowledge Base:
            <a href="http://support.microsoft.com/kb/256986/EN-US/" target="_top">http://support.microsoft.com/kb/256986/EN-US/</a>.
            </strong></span>
          </p><div class="orderedlist"><ol type="1"><li><p>
                Start Registry Editor
                (<code class="filename">Regedt32.exe</code>).
              </p></li><li><p>
                Locate the following key in the registry:
              </p><pre class="programlisting">HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
</pre></li><li><p>
                On the <code class="literal">Edit</code> menu, click <code class="literal">Add
                Value</code>, and then add the following registry
                value:
              </p><pre class="programlisting">Value Name: MaxUserPort
Data Type: REG_DWORD
Value: 65534
</pre><p>
                This sets the number of ephemeral ports available to any
                user. The valid range is between 5000 and 65534
                (decimal). The default value is 0x1388 (5000 decimal).
              </p></li><li><p>
                On the <code class="literal">Edit</code> menu, click <code class="literal">Add
                Value</code>, and then add the following registry
                value:
              </p><pre class="programlisting">Value Name: TcpTimedWaitDelay
Data Type: REG_DWORD
Value: 30
</pre><p>
                This sets the number of seconds to hold a TCP port
                connection in <code class="literal">TIME_WAIT</code> state before
                closing. The valid range is between 0 (zero) and 300
                (decimal). The default value is 0x78 (120 decimal).
              </p></li><li><p>
                Quit Registry Editor.
              </p></li><li><p>
                Reboot the machine.
              </p></li></ol></div><p>
            Note: Undoing the above should be as simple as deleting the
            registry entries you've created.
          </p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="error-lost-connection"></a>B.1.2.3. <code class="literal">Lost connection to MySQL server</code></h4></div></div></div><a class="indexterm" name="id3177686"></a><a class="indexterm" name="id3177699"></a><a class="indexterm" name="id3177711"></a><p>
          An error of the form <code class="literal">Lost connection to MySQL server
          at '<em class="replaceable"><code>XXX</code></em>', system error:
          <em class="replaceable"><code>errno</code></em></code> can indicate that
          the server's <code class="literal">connect_timeout</code> value is set
          too low.
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="old-client"></a>B.1.2.4. <code class="literal">Client does not support authentication protocol</code></h4></div></div></div><p>
          MySQL 5.0 uses an authentication protocol based
          on a password hashing algorithm that is incompatible with that
          used by older (pre-4.1) clients. If you upgrade the server
          from 4.0, attempts to connect to it with an older client may
          fail with the following message:
        </p><pre class="programlisting">shell&gt; <strong class="userinput"><code>mysql</code></strong>
Client does not support authentication protocol requested
by server; consider upgrading MySQL client
</pre><p>
          To solve this problem, you should use one of the following
          approaches:
        </p><div class="itemizedlist"><ul type="disc"><li><p>
              Upgrade all client programs to use a 4.1.1 or newer client
              library.
            </p></li><li><p>
              When connecting to the server with a pre-4.1 client
              program, use an account that still has a pre-4.1-style
              password.
            </p></li><li><p>
              Reset the password to pre-4.1 style for each user that
              needs to use a pre-4.1 client program. This can be done
              using the <code class="literal">SET PASSWORD</code> statement and
              the <a href="functions.html#function_old-password"><code class="literal">OLD_PASSWORD()</code></a>
              function:
            </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>SET PASSWORD FOR</code></strong>
    -&gt; <strong class="userinput"><code>'<em class="replaceable"><code>some_user</code></em>'@'<em class="replaceable"><code>some_host</code></em>' = OLD_PASSWORD('<em class="replaceable"><code>newpwd</code></em>');</code></strong>
</pre><p>
              Alternatively, use <code class="literal">UPDATE</code> and
              <code class="literal">FLUSH PRIVILEGES</code>:
            </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>UPDATE mysql.user SET Password = OLD_PASSWORD('<em class="replaceable"><code>newpwd</code></em>')</code></strong>
    -&gt; <strong class="userinput"><code>WHERE Host = '<em class="replaceable"><code>some_host</code></em>' AND User = '<em class="replaceable"><code>some_user</code></em>';</code></strong>
mysql&gt; <strong class="userinput"><code>FLUSH PRIVILEGES;</code></strong>
</pre><p>
              Substitute the password you want to use for
              “<span class="quote"><em class="replaceable"><code>newpwd</code></em></span>” in the
              preceding examples. MySQL cannot tell you what the
              original password was, so you'll need to pick a new one.
            </p></li><li><p>
              Tell the server to use the older password hashing
              algorithm:
            </p><div class="orderedlist"><ol type="1"><li><p>
                  Start <span><strong class="command">mysqld</strong></span> with the
                  <code class="option">--old-passwords</code> option.
                </p></li><li><p>
                  Assign an old-format password to each account that has
                  had its password updated to the longer 4.1 format. You
                  can identify these accounts with the following query:
                </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>SELECT Host, User, Password FROM mysql.user</code></strong>
    -&gt; <strong class="userinput"><code>WHERE LENGTH(Password) &gt; 16;</code></strong>
</pre><p>
                  For each account record displayed by the query, use
                  the <code class="literal">Host</code> and
                  <code class="literal">User</code> values and assign a password
                  using the
                  <a href="functions.html#function_old-password"><code class="literal">OLD_PASSWORD()</code></a>
                  function and either <code class="literal">SET PASSWORD</code> or
                  <code class="literal">UPDATE</code>, as described earlier.
                </p></li></ol></div></li></ul></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
            In older versions of PHP, the <code class="literal">mysql</code>
            extension does not support the authentication protocol in
            MySQL 4.1.1 and higher. This is true regardless of the PHP
            version being used. If you wish to use the
            <code class="literal">mysql</code> extension with MySQL 4.1 or newer,
            you may need to follow one of the options discussed above
            for configuring MySQL to work with old clients. The
            <code class="literal">mysqli</code> extension (stands for "MySQL,
            Improved"; added in PHP 5) is compatible with the improved
            password hashing employed in MySQL 4.1 and higher, and no
            special configuration of MySQL need be done to use this
            MySQL client library. For more information about the
            <code class="literal">mysqli</code> extension, see
            <a href="http://php.net/mysqli" target="_top">http://php.net/mysqli</a>.
          </p></div><p>
          It may also be possible to compile the older
          <code class="literal">mysql</code> extension against the new MySQL
          client library. This is beyond the scope of this Manual;
          consult the PHP documentation for more information. You also
          be able to obtain assistance with these issues in our
          <a href="http://forums.mysql.com/list.php?52" target="_top">MySQL with PHP
          forum</a>.
        </p><p>
          For additional background on password hashing and
          authentication, see <a href="server-administration.html#password-hashing" title="5.7.9. Password Hashing as of MySQL 4.1">Section 5.7.9, “Password Hashing as of MySQL 4.1”</a>.
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="password-too-long"></a>B.1.2.5. Password Fails When Entered Interactively</h4></div></div></div><p>
          MySQL client programs prompt for a password when invoked with
          a <code class="option">--password</code> or <code class="option">-p</code> option
          that has no following password value:
        </p><pre class="programlisting">shell&gt; <strong class="userinput"><code>mysql -u <em class="replaceable"><code>user_name</code></em> -p</code></strong>
Enter password:
</pre><p>
          On some systems, you may find that your password works when
          specified in an option file or on the command line, but not
          when you enter it interactively at the <code class="literal">Enter
          password:</code> prompt. This occurs when the library
          provided by the system to read passwords limits password
          values to a small number of characters (typically eight). That
          is a problem with the system library, not with MySQL. To work
          around it, change your MySQL password to a value that is eight
          or fewer characters long, or put your password in an option
          file.
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="blocked-host"></a>B.1.2.6. <code class="literal">Host '<em class="replaceable"><code>host_name</code></em>' is
          blocked</code></h4></div></div></div><p>
          If you get the following error, it means that
          <span><strong class="command">mysqld</strong></span> has received many connect requests
          from the host
          <code class="literal">'<em class="replaceable"><code>host_name</code></em>'</code> that
          have been interrupted in the middle:
        </p><pre class="programlisting">Host '<em class="replaceable"><code>host_name</code></em>' is blocked because of many connection errors.
Unblock with 'mysqladmin flush-hosts'
</pre><p>
          The number of interrupted connect requests allowed is
          determined by the value of the
          <code class="literal">max_connect_errors</code> system variable. After
          <code class="literal">max_connect_errors</code> failed requests,
          <span><strong class="command">mysqld</strong></span> assumes that something is wrong (for
          example, that someone is trying to break in), and blocks the
          host from further connections until you execute a
          <span><strong class="command">mysqladmin flush-hosts</strong></span> command or issue a
          <code class="literal">FLUSH HOSTS</code> statement. See
          <a href="server-administration.html#server-system-variables" title="5.2.3. System Variables">Section 5.2.3, “System Variables”</a>.
        </p><p>
          By default, <span><strong class="command">mysqld</strong></span> blocks a host after 10
          connection errors. You can adjust the value by starting the
          server like this:
        </p><pre class="programlisting">shell&gt; <strong class="userinput"><code>mysqld_safe --max_connect_errors=10000 &amp;</code></strong>
</pre><p>
          If you get this error message for a given host, you should
          first verify that there isn't anything wrong with TCP/IP
          connections from that host. If you are having network
          problems, it does you no good to increase the value of the
          <code class="literal">max_connect_errors</code> variable.
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="too-many-connections"></a>B.1.2.7. <code class="literal">Too many connections</code></h4></div></div></div><p>
          If you get a <code class="literal">Too many connections</code> error
          when you try to connect to the <span><strong class="command">mysqld</strong></span>
          server, this means that all available connections are in use
          by other clients.
        </p><p>
          The number of connections allowed is controlled by the
          <code class="literal">max_connections</code> system variable. Its
          default value is 100. If you need to support more connections,
          you should set a larger value for this variable.
        </p><p class="mnmas"><b>MySQL Enterprise</b>
            Subscribers to the MySQL Enterprise Monitor receive advice
            on dynamically configuring the
            <code class="literal">max_connections</code> variable — avoiding
            failed connection attempts. For more information, see
            <a href="http://www.mysql.com/products/enterprise/advisors.html" target="_top">http://www.mysql.com/products/enterprise/advisors.html</a>.
          </p><p>
          <span><strong class="command">mysqld</strong></span> actually allows
          <code class="literal">max_connections+1</code> clients to connect. The
          extra connection is reserved for use by accounts that have the
          <code class="literal">SUPER</code> privilege. By granting the
          <code class="literal">SUPER</code> privilege to administrators and not
          to normal users (who should not need it), an administrator can
          connect to the server and use <code class="literal">SHOW
          PROCESSLIST</code> to diagnose problems even if the maximum
          number of unprivileged clients are connected. See
          <a href="sql-syntax.html#show-processlist" title="12.5.4.21. SHOW PROCESSLIST Syntax">Section 12.5.4.21, “<code class="literal">SHOW PROCESSLIST</code> Syntax”</a>.
        </p><p>
          The maximum number of connections MySQL can support depends on
          the quality of the thread library on a given platform. Linux
          or Solaris should be able to support 500-1000 simultaneous
          connections, depending on how much RAM you have and what your
          clients are doing. Static Linux binaries provided by MySQL AB
          can support up to 4000 connections.
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="out-of-memory"></a>B.1.2.8. <code class="literal">Out of memory</code></h4></div></div></div><p>
          If you issue a query using the <span><strong class="command">mysql</strong></span> client
          program and receive an error like the following one, it means
          that <span><strong class="command">mysql</strong></span> does not have enough memory to
          store the entire query result:
        </p><pre class="programlisting">mysql: Out of memory at line 42, 'malloc.c'
mysql: needed 8136 byte (8k), memory in use: 12481367 bytes (12189k)
ERROR 2008: MySQL client ran out of memory
</pre><p>
          To remedy the problem, first check whether your query is
          correct. Is it reasonable that it should return so many rows?
          If not, correct the query and try again. Otherwise, you can
          invoke <span><strong class="command">mysql</strong></span> with the
          <code class="option">--quick</code> option. This causes it to use the
          <a href="apis.html#mysql-use-result" title="23.2.3.71. mysql_use_result()"><code class="literal">mysql_use_result()</code></a> C API
          function to retrieve the result set, which places less of a
          load on the client (but more on the server).
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="gone-away"></a>B.1.2.9. <code class="literal">MySQL server has gone away</code></h4></div></div></div><a class="indexterm" name="id3178503"></a><a class="indexterm" name="id3178512"></a><p>
          This section also covers the related <code class="literal">Lost connection
          to server during query</code> error.
        </p><p>
          The most common reason for the <code class="literal">MySQL server has gone
          away</code> error is that the server timed out and closed
          the connection. In this case, you normally get one of the
          following error codes (which one you get is operating
          system-dependent):
        </p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td><span class="bold"><strong>Error Code</strong></span></td><td><span class="bold"><strong>Description</strong></span></td></tr><tr><td><code class="literal">CR_SERVER_GONE_ERROR</code></td><td>The client couldn't send a question to the server.</td></tr><tr><td><code class="literal">CR_SERVER_LOST</code></td><td>The client didn't get an error when writing to the server, but it didn't
                  get a full answer (or any answer) to the question.</td></tr></tbody></table></div><p>
          By default, the server closes the connection after eight hours
          if nothing has happened. You can change the time limit by
          setting the <code class="literal">wait_timeout</code> variable when you
          start <span><strong class="command">mysqld</strong></span>. See
          <a href="server-administration.html#server-system-variables" title="5.2.3. System Variables">Section 5.2.3, “System Variables”</a>.
        </p><p>
          If you have a script, you just have to issue the query again
          for the client to do an automatic reconnection. This assumes
          that you have automatic reconnection in the client enabled
          (which is the default for the <code class="literal">mysql</code>
          command-line client).
        </p><p>
          Some other common reasons for the <code class="literal">MySQL server has
          gone away</code> error are:
        </p><div class="itemizedlist"><ul type="disc"><li><p>
              You (or the db administrator) has killed the running
              thread with a <code class="literal">KILL</code> statement or a
              <span><strong class="command">mysqladmin kill</strong></span> command.
            </p></li><li><p>
              You tried to run a query after closing the connection to
              the server. This indicates a logic error in the
              application that should be corrected.
            </p></li><li><p>
              A client application running on a different host does not
              have the necessary privileges to connect to the MySQL
              server from that host.
            </p></li><li><p>
              You got a timeout from the TCP/IP connection on the client
              side. This may happen if you have been using the commands:
              <a href="apis.html#mysql-options" title="23.2.3.49. mysql_options()"><code class="literal">mysql_options(...,
              MYSQL_OPT_READ_TIMEOUT,...)</code></a> or
              <a href="apis.html#mysql-options" title="23.2.3.49. mysql_options()"><code class="literal">mysql_options(...,
              MYSQL_OPT_WRITE_TIMEOUT,...)</code></a>. In this case
              increasing the timeout may help solve the problem.
            </p></li><li><p>
              You have encountered a timeout on the server side and the
              automatic reconnection in the client is disabled (the
              <code class="literal">reconnect</code> flag in the
              <code class="literal">MYSQL</code> structure is equal to 0).
            </p></li><li><p>
              You are using a Windows client and the server had dropped
              the connection (probably because
              <code class="literal">wait_timeout</code> expired) before the
              command was issued.
            </p><p>
              The problem on Windows is that in some cases MySQL doesn't
              get an error from the OS when writing to the TCP/IP
              connection to the server, but instead gets the error when
              trying to read the answer from the connection.
            </p><p>
              Prior to MySQL 5.0.19, even if the
              <code class="literal">reconnect</code> flag in the
              <code class="literal">MYSQL</code> structure is equal to 1, MySQL
              does not automatically reconnect and re-issue the query as
              it doesn't know if the server did get the original query
              or not.
            </p><p>
              The solution to this is to either do a
              <a href="apis.html#mysql-ping" title="23.2.3.50. mysql_ping()"><code class="literal">mysql_ping()</code></a> on the
              connection if there has been a long time since the last
              query (this is what <code class="literal">MyODBC</code> does) or set
              <code class="literal">wait_timeout</code> on the
              <span><strong class="command">mysqld</strong></span> server so high that it in
              practice never times out.
            </p></li><li><p>
              You can also get these errors if you send a query to the
              server that is incorrect or too large. If
              <span><strong class="command">mysqld</strong></span> receives a packet that is too
              large or out of order, it assumes that something has gone
              wrong with the client and closes the connection. If you
              need big queries (for example, if you are working with big
              <code class="literal">BLOB</code> columns), you can increase the
              query limit by setting the server's
              <code class="literal">max_allowed_packet</code> variable, which has
              a default value of 1MB. You may also need to increase the
              maximum packet size on the client end. More information on
              setting the packet size is given in
              <a href="error-handling.html#packet-too-large" title="B.1.2.10. Packet too large">Section B.1.2.10, “<code class="literal">Packet too large</code>”</a>.
            </p><p>
              An <code class="literal">INSERT</code> or <code class="literal">REPLACE</code>
              statement that inserts a great many rows can also cause
              these sorts of errors. Either one of these statements
              sends a single request to the server irrespective of the
              number of rows to be inserted; thus, you can often avoid
              the error by reducing the number of rows sent per
              <code class="literal">INSERT</code> or <code class="literal">REPLACE</code>.
            </p></li><li><p>
              You also get a lost connection if you are sending a packet
              16MB or larger if your client is older than 4.0.8 and your
              server is 4.0.8 and above, or the other way around.
            </p></li><li><p>
              It is also possible to see this error if hostname lookups
              fail (for example, if the DNS server on which your server
              or network relies goes down). This is because MySQL is
              dependent on the host system for name resolution, but has
              no way of knowing whether it is working — from
              MySQL's point of view the problem is indistinguishable
              from any other network timeout.
            </p><p>
              You may also see the <code class="literal">MySQL server has gone
              away</code> error if MySQL is started with the
              <code class="option">--skip-networking</code> option.
            </p><p>
              Another networking issue that can cause this error occurs
              if the MySQL port (default 3306) is blocked by your
              firewall, thus preventing any connections at all to the
              MySQL server.
            </p></li><li><p>
              You can also encounter this error with applications that
              fork child processes, all of which try to use the same
              connection to the MySQL server. This can be avoided by
              using a separate connection for each child process.
            </p></li><li><p>
              You have encountered a bug where the server died while
              executing the query.
            </p></li></ul></div><p>
          You can check whether the MySQL server died and restarted by
          executing <span><strong class="command">mysqladmin version</strong></span> and examining
          the server's uptime. If the client connection was broken
          because <span><strong class="command">mysqld</strong></span> crashed and restarted, you
          should concentrate on finding the reason for the crash. Start
          by checking whether issuing the query again kills the server
          again. See <a href="error-handling.html#crashing" title="B.1.4.2. What to Do If MySQL Keeps Crashing">Section B.1.4.2, “What to Do If MySQL Keeps Crashing”</a>.
        </p><p>
          You can get more information about the lost connections by
          starting mysqld with the <code class="option">--log-warnings=2</code>
          option. This logs some of the disconnected errors in the
          <code class="literal">hostname.err</code> file. See
          <a href="server-administration.html#error-log" title="5.10.1. The Error Log">Section 5.10.1, “The Error Log”</a>.
        </p><p>
          If you want to create a bug report regarding this problem, be
          sure that you include the following information:
        </p><div class="itemizedlist"><ul type="disc"><li><p>
              Indicate whether the MySQL server died. You can find
              information about this in the server error log. See
              <a href="error-handling.html#crashing" title="B.1.4.2. What to Do If MySQL Keeps Crashing">Section B.1.4.2, “What to Do If MySQL Keeps Crashing”</a>.
            </p></li><li><p>
              If a specific query kills <span><strong class="command">mysqld</strong></span> and
              the tables involved were checked with <code class="literal">CHECK
              TABLE</code> before you ran the query, can you provide
              a reproducible test case? See
              <a href="http://forge.mysql.com/wiki/MySQL_Internals_Porting" target="_top">MySQL
              Internals: Porting</a>.
            </p></li><li><p>
              What is the value of the <code class="literal">wait_timeout</code>
              system variable in the MySQL server? (<span><strong class="command">mysqladmin
              variables</strong></span> gives you the value of this variable.)
            </p></li><li><p>
              Have you tried to run <span><strong class="command">mysqld</strong></span> with the
              <code class="option">--log</code> option to determine whether the
              problem query appears in the log?
            </p></li></ul></div><p>
          See also <a href="error-handling.html#communication-errors" title="B.1.2.11. Communication Errors and Aborted Connections">Section B.1.2.11, “Communication Errors and Aborted Connections”</a>, and
          <a href="introduction.html#bug-reports" title="1.7. How to Report Bugs or Problems">Section 1.7, “How to Report Bugs or Problems”</a>.
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="packet-too-large"></a>B.1.2.10. <code class="literal">Packet too large</code></h4></div></div></div><p>
          A communication packet is a single SQL statement sent to the
          MySQL server, a single row that is sent to the client, or a
          binary log event sent from a master replication server to a
          slave.
        </p><p>
          The largest possible packet that can be transmitted to or from
          a MySQL 5.0 server or client is 1GB.
        </p><p>
          When a MySQL client or the <span><strong class="command">mysqld</strong></span> server
          receives a packet bigger than
          <code class="literal">max_allowed_packet</code> bytes, it issues a
          <code class="literal">Packet too large</code> error and closes the
          connection. With some clients, you may also get a
          <code class="literal">Lost connection to MySQL server during
          query</code> error if the communication packet is too
          large.
        </p><p>
          Both the client and the server have their own
          <code class="literal">max_allowed_packet</code> variable, so if you want
          to handle big packets, you must increase this variable both in
          the client and in the server.
        </p><p>
          If you are using the <span><strong class="command">mysql</strong></span> client program,
          its default <code class="literal">max_allowed_packet</code> variable is
          16MB. To set a larger value, start <span><strong class="command">mysql</strong></span>
          like this:
        </p><pre class="programlisting">shell&gt; <strong class="userinput"><code>mysql --max_allowed_packet=32M</code></strong>
</pre><p>
          That sets the packet size to 32MB.
        </p><p>
          The server's default <code class="literal">max_allowed_packet</code>
          value is 1MB. You can increase this if the server needs to
          handle big queries (for example, if you are working with big
          <code class="literal">BLOB</code> columns). For example, to set the
          variable to 16MB, start the server like this:
        </p><pre class="programlisting">shell&gt; <strong class="userinput"><code>mysqld --max_allowed_packet=16M</code></strong>
</pre><p>
          You can also use an option file to set
          <code class="literal">max_allowed_packet</code>. For example, to set the
          size for the server to 16MB, add the following lines in an
          option file:
        </p><pre class="programlisting">[mysqld]
max_allowed_packet=16M
</pre><p>
          It is safe to increase the value of this variable because the
          extra memory is allocated only when needed. For example,
          <span><strong class="command">mysqld</strong></span> allocates more memory only when you
          issue a long query or when <span><strong class="command">mysqld</strong></span> must
          return a large result row. The small default value of the
          variable is a precaution to catch incorrect packets between
          the client and server and also to ensure that you do not run
          out of memory by using large packets accidentally.
        </p><p>
          You can also get strange problems with large packets if you
          are using large <code class="literal">BLOB</code> values but have not
          given <span><strong class="command">mysqld</strong></span> access to enough memory to
          handle the query. If you suspect this is the case, try adding
          <span><strong class="command">ulimit -d 256000</strong></span> to the beginning of the
          <span><strong class="command">mysqld_safe</strong></span> script and restarting
          <span><strong class="command">mysqld</strong></span>.
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="communication-errors"></a>B.1.2.11. Communication Errors and Aborted Connections</h4></div></div></div><a class="indexterm" name="id3179369"></a><a class="indexterm" name="id3179378"></a><a class="indexterm" name="id3179387"></a><p>
          The server error log can be a useful source of information
          about connection problems. See <a href="server-administration.html#error-log" title="5.10.1. The Error Log">Section 5.10.1, “The Error Log”</a>. If
          you start the server with the <code class="option">--log-warnings</code>
          option, you might find messages like this in your error log:
        </p><pre class="programlisting">010301 14:38:23  Aborted connection 854 to db: 'users' user: 'josh'
</pre><p>
          If <code class="literal">Aborted connections</code> messages appear in
          the error log, the cause can be any of the following:
        </p><div class="itemizedlist"><ul type="disc"><li><p>
              The client program did not call
              <a href="apis.html#mysql-close" title="23.2.3.5. mysql_close()"><code class="literal">mysql_close()</code></a> before
              exiting.
            </p></li><li><p>
              The client had been sleeping more than
              <code class="literal">wait_timeout</code> or
              <code class="literal">interactive_timeout</code> seconds without
              issuing any requests to the server. See
              <a href="server-administration.html#server-system-variables" title="5.2.3. System Variables">Section 5.2.3, “System Variables”</a>.
            </p></li><li><p>
              The client program ended abruptly in the middle of a data
              transfer.
            </p></li></ul></div><p>
          When any of these things happen, the server increments the
          <code class="literal">Aborted_clients</code> status variable.
        </p><p>
          The server increments the <code class="literal">Aborted_connects</code>
          status variable when the following things happen:
        </p><div class="itemizedlist"><ul type="disc"><li><p>
              A client doesn't have privileges to connect to a database.
            </p></li><li><p>
              A client uses an incorrect password.
            </p></li><li><p>
              A connection packet doesn't contain the right information.
            </p></li><li><p>
              It takes more than <code class="literal">connect_timeout</code>
              seconds to get a connect packet. See
              <a href="server-administration.html#server-system-variables" title="5.2.3. System Variables">Section 5.2.3, “System Variables”</a>.
            </p></li></ul></div><p>
          If these kinds of things happen, it might indicate that
          someone is trying to break into your server!
        </p><p class="mnmas"><b>MySQL Enterprise</b>
            For reasons of security and performance the advisors
            provided by the MySQL Enterprise Monitor pay special
            attention to the <code class="literal">Aborted_connections</code>
            status variable. For more information, see
            <a href="http://www.mysql.com/products/enterprise/advisors.html" target="_top">http://www.mysql.com/products/enterprise/advisors.html</a>.
          </p><p>
          Other reasons for problems with aborted clients or aborted
          connections:
        </p><div class="itemizedlist"><ul type="disc"><li><p>
              Use of Ethernet protocol with Linux, both half and full
              duplex. Many Linux Ethernet drivers have this bug. You
              should test for this bug by transferring a huge file via
              FTP between the client and server machines. If a transfer
              goes in burst-pause-burst-pause mode, you are experiencing
              a Linux duplex syndrome. The only solution is switching
              the duplex mode for both your network card and hub/switch
              to either full duplex or to half duplex and testing the
              results to determine the best setting.
            </p></li><li><p>
              Some problem with the thread library that causes
              interrupts on reads.
            </p></li><li><p>
              Badly configured TCP/IP.
            </p></li><li><p>
              Faulty Ethernets, hubs, switches, cables, and so forth.
              This can be diagnosed properly only by replacing hardware.
            </p></li><li><p>
              The <code class="literal">max_allowed_packet</code> variable value
              is too small or queries require more memory than you have
              allocated for <span><strong class="command">mysqld</strong></span>. See
              <a href="error-handling.html#packet-too-large" title="B.1.2.10. Packet too large">Section B.1.2.10, “<code class="literal">Packet too large</code>”</a>.
            </p></li></ul></div><p>
          See also <a href="error-handling.html#gone-away" title="B.1.2.9. MySQL server has gone away">Section B.1.2.9, “<code class="literal">MySQL server has gone away</code>”</a>.
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="full-table"></a>B.1.2.12. <code class="literal">The table is full</code></h4></div></div></div><a class="indexterm" name="id3179685"></a><a class="indexterm" name="id3179694"></a><a class="indexterm" name="id3179707"></a><a class="indexterm" name="id3179716"></a><a class="indexterm" name="id3179729"></a><a class="indexterm" name="id3179741"></a><p>
          The effective maximum table size for MySQL databases is
          usually determined by operating system constraints on file
          sizes, not by MySQL internal limits. The following table lists
          some examples of operating system file-size limits. This is
          only a rough guide and is not intended to be definitive. For
          the most up-to-date information, be sure to check the
          documentation specific to your operating system.
        </p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td><span class="bold"><strong>Operating System</strong></span></td><td><span class="bold"><strong>File-size Limit</strong></span></td></tr><tr><td>Win32 w/ FAT/FAT32</td><td>2GB/4GB</td></tr><tr><td>Win32 w/ NTFS</td><td>2TB (possibly larger)</td></tr><tr><td>Linux 2.2-Intel 32-bit</td><td>2GB (LFS: 4GB)</td></tr><tr><td>Linux 2.4+</td><td>(using ext3 filesystem) 4TB</td></tr><tr><td>Solaris 9/10</td><td>16TB</td></tr><tr><td>MacOS X w/ HFS+</td><td>2TB</td></tr><tr><td>NetWare w/NSS filesystem</td><td>8TB</td></tr></tbody></table></div><p>
          Windows users, please note that FAT and VFAT (FAT32) are
          <span class="emphasis"><em>not</em></span> considered suitable for production
          use with MySQL. Use NTFS instead.
        </p><p>
          On Linux 2.2, you can get <code class="literal">MyISAM</code> tables
          larger than 2GB in size by using the Large File Support (LFS)
          patch for the ext2 filesystem. Most current Linux
          distributions are based on kernel 2.4 or higher and include
          all the required LFS patches. On Linux 2.4, patches also exist
          for ReiserFS to get support for big files (up to 2TB). With
          JFS and XFS, petabyte and larger files are possible on Linux.
        </p><p>
          For a detailed overview about LFS in Linux, have a look at
          Andreas Jaeger's <em class="citetitle">Large File Support in
          Linux</em> page at
          <a href="http://www.suse.de/~aj/linux_lfs.html" target="_top">http://www.suse.de/~aj/linux_lfs.html</a>.
        </p><p>
          If you do encounter a full-table error, there are several
          reasons why it might have occurred:
        </p><div class="itemizedlist"><ul type="disc"><li><p>
              The <code class="literal">InnoDB</code> storage engine maintains
              <code class="literal">InnoDB</code> tables within a tablespace that
              can be created from several files. This allows a table to
              exceed the maximum individual file size. The tablespace
              can include raw disk partitions, which allows extremely
              large tables. The maximum tablespace size is 64TB.
            </p><p>
              If you are using <code class="literal">InnoDB</code> tables and run
              out of room in the <code class="literal">InnoDB</code> tablespace.
              In this case, the solution is to extend the
              <code class="literal">InnoDB</code> tablespace. See
              <a href="storage-engines.html#adding-and-removing" title="13.2.7. Adding and Removing InnoDB Data and Log Files">Section 13.2.7, “Adding and Removing <code class="literal">InnoDB</code> Data and Log Files”</a>.
            </p></li><li><p>
              You are using <code class="literal">MyISAM</code> tables on an
              operating system that supports files only up to 2GB in
              size and you have hit this limit for the data file or
              index file.
            </p></li><li><p>
              You are using a <code class="literal">MyISAM</code> table and the
              space required for the table exceeds what is allowed by
              the internal pointer size. <code class="literal">MyISAM</code>
              creates tables to allow up to 4GB by default (256TB as of
              MySQL 5.0.6), but this limit can be changed up to the
              maximum allowable size of 65,536TB
              (256<sup>7</sup> – 1 bytes).
            </p><p>
              If you need a <code class="literal">MyISAM</code> table that is
              larger than the default limit and your operating system
              supports large files, the <code class="literal">CREATE TABLE</code>
              statement supports <code class="literal">AVG_ROW_LENGTH</code> and
              <code class="literal">MAX_ROWS</code> options. See
              <a href="sql-syntax.html#create-table" title="12.1.5. CREATE TABLE Syntax">Section 12.1.5, “<code class="literal">CREATE TABLE</code> Syntax”</a>. The server uses these
              options to determine how large a table to allow.
            </p><p>
              If the pointer size is too small for an existing table,
              you can change the options with <code class="literal">ALTER
              TABLE</code> to increase a table's maximum allowable
              size. See <a href="sql-syntax.html#alter-table" title="12.1.2. ALTER TABLE Syntax">Section 12.1.2, “<code class="literal">ALTER TABLE</code> Syntax”</a>.
            </p><pre class="programlisting">ALTER TABLE <em class="replaceable"><code>tbl_name</code></em> MAX_ROWS=1000000000 AVG_ROW_LENGTH=<em class="replaceable"><code>nnn</code></em>;
</pre><p>
              You have to specify <code class="literal">AVG_ROW_LENGTH</code> only
              for tables with <code class="literal">BLOB</code> or
              <code class="literal">TEXT</code> columns; in this case, MySQL can't
              optimize the space required based only on the number of
              rows.
            </p><p>
              To change the default size limit for
              <code class="literal">MyISAM</code> tables, set the
              <code class="literal">myisam_data_pointer_size</code>, which sets
              the number of bytes used for internal row pointers. The
              value is used to set the pointer size for new tables if
              you do not specify the <code class="literal">MAX_ROWS</code> option.
              The value of <code class="literal">myisam_data_pointer_size</code>
              can be from 2 to 7. A value of 4 allows tables up to 4GB;
              a value of 6 allows tables up to 256TB.
            </p><p>
              You can check the maximum data and index sizes by using
              this statement:
            </p><pre class="programlisting">SHOW TABLE STATUS FROM <em class="replaceable"><code>db_name</code></em> LIKE '<em class="replaceable"><code>tbl_name</code></em>';
</pre><p>
              You also can use <span><strong class="command">myisamchk -dv
              /path/to/table-index-file</strong></span>. See
              <a href="sql-syntax.html#show" title="12.5.4. SHOW Syntax">Section 12.5.4, “<code class="literal">SHOW</code> Syntax”</a>, or <a href="client-utility-programs.html#myisamchk" title="7.4. myisamchk — MyISAM Table-Maintenance Utility">Section 7.4, “<span><strong class="command">myisamchk</strong></span> — MyISAM Table-Maintenance Utility”</a>.
            </p><p>
              Other ways to work around file-size limits for
              <code class="literal">MyISAM</code> tables are as follows:
            </p><div class="itemizedlist"><ul type="circle"><li><p>
                  If your large table is read only, you can use
                  <span><strong class="command">myisampack</strong></span> to compress it.
                  <span><strong class="command">myisampack</strong></span> usually compresses a
                  table by at least 50%, so you can have, in effect,
                  much bigger tables. <span><strong class="command">myisampack</strong></span> also
                  can merge multiple tables into a single table. See
                  <a href="client-utility-programs.html#myisampack" title="7.6. myisampack — Generate Compressed, Read-Only MyISAM Tables">Section 7.6, “<span><strong class="command">myisampack</strong></span> — Generate Compressed, Read-Only MyISAM Tables”</a>.
                </p></li><li><p>
                  MySQL includes a <code class="literal">MERGE</code> library that
                  allows you to handle a collection of
                  <code class="literal">MyISAM</code> tables that have identical
                  structure as a single <code class="literal">MERGE</code> table.
                  See <a href="storage-engines.html#merge-storage-engine" title="13.3. The MERGE Storage Engine">Section 13.3, “The <code class="literal">MERGE</code> Storage Engine”</a>.
                </p></li></ul></div></li><li><p>
              You are using the <code class="literal">NDB</code> storage engine,
              in which case you need to increase the values for the
              <code class="literal">DataMemory</code> and
              <code class="literal">IndexMemory</code> configuration parameters in
              your <code class="filename">config.ini</code> file. See
              <a href="mysql-cluster.html#mysql-cluster-config-params-ndbd" title="16.3.5.1. Data Node Configuration Parameters">Section 16.3.5.1, “Data Node Configuration Parameters”</a>.
            </p></li><li><p>
              You are using the <code class="literal">MEMORY</code>
              (<code class="literal">HEAP</code>) storage engine; in this case you
              need to increase the value of the
              <code class="literal">max_heap_table_size</code> system variable.
              See <a href="server-administration.html#server-system-variables" title="5.2.3. System Variables">Section 5.2.3, “System Variables”</a>.
            </p></li></ul></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="cannot-create"></a>B.1.2.13. <code class="literal">Can't create/write to file</code></h4></div></div></div><a class="indexterm" name="id3180354"></a><p>
          If you get an error of the following type for some queries, it
          means that MySQL cannot create a temporary file for the result
          set in the temporary directory:
        </p><pre class="programlisting">Can't create/write to file '\\sqla3fe_0.ism'.
</pre><p>
          The preceding error is a typical message for Windows; the Unix
          message is similar.
        </p><p>
          One fix is to start <span><strong class="command">mysqld</strong></span> with the
          <code class="option">--tmpdir</code> option or to add the option to the
          <code class="literal">[mysqld]</code> section of your option file. For
          example, to specify a directory of
          <code class="filename">C:\temp</code>, use these lines:
        </p><pre class="programlisting">[mysqld]
tmpdir=C:/temp
</pre><p>
          The <code class="filename">C:\temp</code> directory must exist and have
          sufficient space for the MySQL server to write to. See
          <a href="using-mysql-programs.html#option-files" title="4.3.2. Using Option Files">Section 4.3.2, “Using Option Files”</a>.
        </p><p>
          Another cause of this error can be permissions issues. Make
          sure that the MySQL server can write to the
          <code class="literal">tmpdir</code> directory.
        </p><p>
          Check also the error code that you get with
          <span><strong class="command">perror</strong></span>. One reason the server cannot write
          to a table is that the filesystem is full:
        </p><pre class="programlisting">shell&gt; <strong class="userinput"><code>perror 28</code></strong>
OS error code  28:  No space left on device
</pre><p>
          If you get an error of the following type during startup, it
          indicates that the filesystem and/or directory used for
          storing data files is write protected. Providing the write
          error is to a test file, This error is not serious and can be
          safely ignored.
        </p><pre class="programlisting">Can't create test file /usr/local/mysql/data/master.lower-test</pre></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="commands-out-of-sync"></a>B.1.2.14. <code class="literal">Commands out of sync</code></h4></div></div></div><a class="indexterm" name="id3180497"></a><p>
          If you get <code class="literal">Commands out of sync; you can't run this
          command now</code> in your client code, you are calling
          client functions in the wrong order.
        </p><p>
          This can happen, for example, if you are using
          <a href="apis.html#mysql-use-result" title="23.2.3.71. mysql_use_result()"><code class="literal">mysql_use_result()</code></a> and try to
          execute a new query before you have called
          <a href="apis.html#mysql-free-result" title="23.2.3.25. mysql_free_result()"><code class="literal">mysql_free_result()</code></a>. It can
          also happen if you try to execute two queries that return data
          without calling
          <a href="apis.html#mysql-use-result" title="23.2.3.71. mysql_use_result()"><code class="literal">mysql_use_result()</code></a> or
          <a href="apis.html#mysql-store-result" title="23.2.3.69. mysql_store_result()"><code class="literal">mysql_store_result()</code></a> in
          between.
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="ignoring-user"></a>B.1.2.15. <code class="literal">Ignoring user</code></h4></div></div></div><p>
          If you get the following error, it means that when
          <span><strong class="command">mysqld</strong></span> was started or when it reloaded the
          grant tables, it found an account in the
          <code class="literal">user</code> table that had an invalid password.
        </p><p>
          <code class="literal">Found wrong password for user
          '<em class="replaceable"><code>some_user</code></em>'@'<em class="replaceable"><code>some_host</code></em>';
          ignoring user</code>
        </p><p>
          As a result, the account is simply ignored by the permission
          system.
        </p><p>
          The following list indicates possible causes of and fixes for
          this problem:
        </p><div class="itemizedlist"><ul type="disc"><li><p>
              You may be running a new version of
              <span><strong class="command">mysqld</strong></span> with an old
              <code class="literal">user</code> table. You can check this by
              executing <span><strong class="command">mysqlshow mysql user</strong></span> to see
              whether the <code class="literal">Password</code> column is shorter
              than 16 characters. If so, you can correct this condition
              by running the
              <code class="literal">scripts/add_long_password</code> script.
            </p></li><li><p>
              The account has an old password (eight characters long).
              Update the account in the <code class="literal">user</code> table to
              have a new password.
            </p></li><li><p>
              <a class="indexterm" name="id3180677"></a>

              You have specified a password in the
              <code class="literal">user</code> table without using the
              <a href="functions.html#function_password"><code class="literal">PASSWORD()</code></a> function. Use
              <span><strong class="command">mysql</strong></span> to update the account in the
              <code class="literal">user</code> table with a new password, making
              sure to use the <a href="functions.html#function_password"><code class="literal">PASSWORD()</code></a>
              function:
            </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>UPDATE user SET Password=PASSWORD('<em class="replaceable"><code>newpwd</code></em>')</code></strong>
    -&gt; <strong class="userinput"><code>WHERE User='<em class="replaceable"><code>some_user</code></em>' AND Host='<em class="replaceable"><code>some_host</code></em>';</code></strong>
</pre></li></ul></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="cannot-find-table"></a>B.1.2.16. <code class="literal">Table '<em class="replaceable"><code>tbl_name</code></em>' doesn't
          exist</code></h4></div></div></div><p>
          If you get either of the following errors, it usually means
          that no table exists in the default database with the given
          name:
        </p><pre class="programlisting">Table '<em class="replaceable"><code>tbl_name</code></em>' doesn't exist
Can't find file: '<em class="replaceable"><code>tbl_name</code></em>' (errno: 2)
</pre><p>
          In some cases, it may be that the table does exist but that
          you are referring to it incorrectly:
        </p><div class="itemizedlist"><ul type="disc"><li><p>
              Because MySQL uses directories and files to store
              databases and tables, database and table names are case
              sensitive if they are located on a filesystem that has
              case-sensitive filenames.
            </p></li><li><p>
              Even for filesystems that are not case sensitive, such as
              on Windows, all references to a given table within a query
              must use the same lettercase.
            </p></li></ul></div><p>
          You can check which tables are in the default database with
          <code class="literal">SHOW TABLES</code>. See <a href="sql-syntax.html#show" title="12.5.4. SHOW Syntax">Section 12.5.4, “<code class="literal">SHOW</code> Syntax”</a>.
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="cannot-initialize-character-set"></a>B.1.2.17. <code class="literal">Can't initialize character set</code></h4></div></div></div><a class="indexterm" name="id3180850"></a><p>
          You might see an error like this if you have character set
          problems:
        </p><pre class="programlisting">MySQL Connection Failed: Can't initialize character set <em class="replaceable"><code>charset_name</code></em>
</pre><p>
          This error can have any of the following causes:
        </p><div class="itemizedlist"><ul type="disc"><li><p>
              The character set is a multi-byte character set and you
              have no support for the character set in the client. In
              this case, you need to recompile the client by running
              <span><strong class="command">configure</strong></span> with the
              <code class="option">--with-charset=<em class="replaceable"><code>charset_name</code></em></code>
              or
              <code class="option">--with-extra-charsets=<em class="replaceable"><code>charset_name</code></em></code>
              option. See <a href="installing.html#configure-options" title="2.4.15.2. Typical configure Options">Section 2.4.15.2, “Typical <span><strong class="command">configure</strong></span> Options”</a>.
            </p><p>
              All standard MySQL binaries are compiled with
              <code class="option">--with-extra-character-sets=complex</code>,
              which enables support for all multi-byte character sets.
              See <a href="internationalization-localization.html#charset-configuration" title="9.2. The Character Set Used for Data and Sorting">Section 9.2, “The Character Set Used for Data and Sorting”</a>.
            </p></li><li><p>
              The character set is a simple character set that is not
              compiled into <span><strong class="command">mysqld</strong></span>, and the character
              set definition files are not in the place where the client
              expects to find them.
            </p><p>
              In this case, you need to use one of the following methods
              to solve the problem:
            </p><div class="itemizedlist"><ul type="circle"><li><p>
                  Recompile the client with support for the character
                  set. See <a href="installing.html#configure-options" title="2.4.15.2. Typical configure Options">Section 2.4.15.2, “Typical <span><strong class="command">configure</strong></span> Options”</a>.
                </p></li><li><p>
                  Specify to the client the directory where the
                  character set definition files are located. For many
                  clients, you can do this with the
                  <code class="option">--character-sets-dir</code> option.
                </p></li><li><p>
                  Copy the character definition files to the path where
                  the client expects them to be.
                </p></li></ul></div></li></ul></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="not-enough-file-handles"></a>B.1.2.18. <span class="errortext">'<em class="replaceable"><code>File</code></em>' Not Found</span> and
          Similar Errors</h4></div></div></div><p>
          If you get <code class="literal">ERROR '...' not found (errno:
          23)</code>, <code class="literal">Can't open file: ... (errno:
          24)</code>, or any other error with <code class="literal">errno
          23</code> or <code class="literal">errno 24</code> from MySQL, it
          means that you haven't allocated enough file descriptors for
          the MySQL server. You can use the <span><strong class="command">perror</strong></span>
          utility to get a description of what the error number means:
        </p><pre class="programlisting">shell&gt; <strong class="userinput"><code>perror 23</code></strong>
OS error code  23:  File table overflow
shell&gt; <strong class="userinput"><code>perror 24</code></strong>
OS error code  24:  Too many open files
shell&gt; <strong class="userinput"><code>perror 11</code></strong>
OS error code  11:  Resource temporarily unavailable
</pre><p>
          The problem here is that <span><strong class="command">mysqld</strong></span> is trying
          to keep open too many files simultaneously. You can either
          tell <span><strong class="command">mysqld</strong></span> not to open so many files at
          once or increase the number of file descriptors available to
          <span><strong class="command">mysqld</strong></span>.
        </p><p>
          To tell <span><strong class="command">mysqld</strong></span> to keep open fewer files at
          a time, you can make the table cache smaller by reducing the
          value of the <code class="literal">table_cache</code> system variable
          (the default value is 64). Reducing the value of
          <code class="literal">max_connections</code> also reduces the number of
          open files (the default value is 100).
        </p><a class="indexterm" name="id3181126"></a><p>
          To change the number of file descriptors available to
          <span><strong class="command">mysqld</strong></span>, you can use the
          <code class="option">--open-files-limit</code> option to
          <span><strong class="command">mysqld_safe</strong></span> or (as of MySQL 3.23.30) set
          the <code class="literal">open_files_limit</code> system variable. See
          <a href="server-administration.html#server-system-variables" title="5.2.3. System Variables">Section 5.2.3, “System Variables”</a>. The easiest way to
          set these values is to add an option to your option file. See
          <a href="using-mysql-programs.html#option-files" title="4.3.2. Using Option Files">Section 4.3.2, “Using Option Files”</a>. If you have an old version of
          <span><strong class="command">mysqld</strong></span> that doesn't support setting the
          open files limit, you can edit the
          <span><strong class="command">mysqld_safe</strong></span> script. There is a
          commented-out line <span><strong class="command">ulimit -n 256</strong></span> in the
          script. You can remove the “<span class="quote"><code class="literal">#</code></span>”
          character to uncomment this line, and change the number
          <code class="literal">256</code> to set the number of file descriptors
          to be made available to <span><strong class="command">mysqld</strong></span>.
        </p><p>
          <code class="option">--open-files-limit</code> and
          <span><strong class="command">ulimit</strong></span> can increase the number of file
          descriptors, but only up to the limit imposed by the operating
          system. There is also a “<span class="quote">hard</span>” limit that can be
          overridden only if you start <span><strong class="command">mysqld_safe</strong></span> or
          <span><strong class="command">mysqld</strong></span> as <code class="literal">root</code> (just
          remember that you also need to start the server with the
          <code class="option">--user</code> option in this case so that it does
          not continue to run as <code class="literal">root</code> after it starts
          up). If you need to increase the operating system limit on the
          number of file descriptors available to each process, consult
          the documentation for your system.
        </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
            If you run the <span><strong class="command">tcsh</strong></span> shell,
            <span><strong class="command">ulimit</strong></span> does not work!
            <span><strong class="command">tcsh</strong></span> also reports incorrect values when
            you ask for the current limits. In this case, you should
            start <span><strong class="command">mysqld_safe</strong></span> using
            <span><strong class="command">sh</strong></span>.
          </p></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="installation-issues"></a>B.1.3. Installation-Related Issues</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="error-handling.html#link-errors">B.1.3.1. Problems Linking to the MySQL Client Library</a></span></dt><dt><span class="section"><a href="error-handling.html#file-permissions">B.1.3.2. Problems with File Permissions</a></span></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="link-errors"></a>B.1.3.1. Problems Linking to the MySQL Client Library</h4></div></div></div><a class="indexterm" name="id3181329"></a><a class="indexterm" name="id3181341"></a><a class="indexterm" name="id3181353"></a><p>
          When you are linking an application program to use the MySQL
          client library, you might get undefined reference errors for
          symbols that start with <code class="literal">mysql_</code>, such as
          those shown here:
        </p><pre class="programlisting">/tmp/ccFKsdPa.o: In function `main':
/tmp/ccFKsdPa.o(.text+0xb): undefined reference to `mysql_init'
/tmp/ccFKsdPa.o(.text+0x31): undefined reference to `mysql_real_connect'
/tmp/ccFKsdPa.o(.text+0x57): undefined reference to `mysql_real_connect'
/tmp/ccFKsdPa.o(.text+0x69): undefined reference to `mysql_error'
/tmp/ccFKsdPa.o(.text+0x9a): undefined reference to `mysql_close'
</pre><p>
          You should be able to solve this problem by adding
          <code class="literal">-Ldir_path -lmysqlclient</code> at the end of your
          link command, where <code class="literal">dir_path</code> represents the
          pathname of the directory where the client library is located.
          To determine the correct directory, try this command:
        </p><pre class="programlisting">shell&gt; <strong class="userinput"><code>mysql_config --libs</code></strong>
</pre><p>
          The output from <span><strong class="command">mysql_config</strong></span> might indicate
          other libraries that should be specified on the link command
          as well.
        </p><p>
          If you get <code class="literal">undefined reference</code> errors for
          the <code class="literal">uncompress</code> or
          <code class="literal">compress</code> function, add
          <code class="literal">-lz</code> to the end of your link command and try
          again.
        </p><p>
          If you get <code class="literal">undefined reference</code> errors for a
          function that should exist on your system, such as
          <code class="literal">connect</code>, check the manual page for the
          function in question to determine which libraries you should
          add to the link command.
        </p><p>
          You might get <code class="literal">undefined reference</code> errors
          such as the following for functions that don't exist on your
          system:
        </p><pre class="programlisting">mf_format.o(.text+0x201): undefined reference to `__lxstat'
</pre><p>
          This usually means that your MySQL client library was compiled
          on a system that is not 100% compatible with yours. In this
          case, you should download the latest MySQL source distribution
          and compile MySQL yourself. See
          <a href="installing.html#installing-source" title="2.4.15. MySQL Installation Using a Source Distribution">Section 2.4.15, “MySQL Installation Using a Source Distribution”</a>.
        </p><p>
          You might get undefined reference errors at runtime when you
          try to execute a MySQL program. If these errors specify
          symbols that start with <code class="literal">mysql_</code> or indicate
          that the <code class="literal">mysqlclient</code> library can't be
          found, it means that your system can't find the shared
          <code class="filename">libmysqlclient.so</code> library. The fix for
          this is to tell your system to search for shared libraries
          where the library is located. Use whichever of the following
          methods is appropriate for your system:
        </p><div class="itemizedlist"><ul type="disc"><li><p>
              Add the path to the directory where
              <code class="filename">libmysqlclient.so</code> is located to the
              <code class="literal">LD_LIBRARY_PATH</code> environment variable.
            </p></li><li><p>
              Add the path to the directory where
              <code class="filename">libmysqlclient.so</code> is located to the
              <code class="literal">LD_LIBRARY</code> environment variable.
            </p></li><li><p>
              Copy <code class="filename">libmysqlclient.so</code> to some
              directory that is searched by your system, such as
              <code class="filename">/lib</code>, and update the shared library
              information by executing <code class="literal">ldconfig</code>.
            </p></li></ul></div><p>
          Another way to solve this problem is by linking your program
          statically with the <code class="literal">-static</code> option, or by
          removing the dynamic MySQL libraries before linking your code.
          Before trying the second method, you should be sure that no
          other programs are using the dynamic libraries.
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="file-permissions"></a>B.1.3.2. Problems with File Permissions</h4></div></div></div><a class="indexterm" name="id3181640"></a><a class="indexterm" name="id3181652"></a><a class="indexterm" name="id3181665"></a><a class="indexterm" name="id3181677"></a><a class="indexterm" name="id3181687"></a><p>
          If you have problems with file permissions, the
          <code class="literal">UMASK</code> environment variable might be set
          incorrectly when <span><strong class="command">mysqld</strong></span> starts. For
          example, MySQL might issue the following error message when
          you create a table:
        </p><pre class="programlisting">ERROR: Can't find file: 'path/with/filename.frm' (Errcode: 13)
</pre><p>
          The default <code class="literal">UMASK</code> value is
          <code class="literal">0660</code>. You can change this behavior by
          starting <span><strong class="command">mysqld_safe</strong></span> as follows:
        </p><pre class="programlisting">shell&gt; <strong class="userinput"><code>UMASK=384  # = 600 in octal</code></strong>
shell&gt; <strong class="userinput"><code>export UMASK</code></strong>
shell&gt; <strong class="userinput"><code>mysqld_safe &amp;</code></strong>
</pre><a class="indexterm" name="id3181773"></a><a class="indexterm" name="id3181782"></a><p>
          By default, MySQL creates database and <code class="literal">RAID</code>
          directories with an access permission value of
          <code class="literal">0700</code>. You can modify this behavior by
          setting the <code class="literal">UMASK_DIR</code> variable. If you set
          its value, new directories are created with the combined
          <code class="literal">UMASK</code> and <code class="literal">UMASK_DIR</code>
          values. For example, if you want to give group access to all
          new directories, you can do this:
        </p><pre class="programlisting">shell&gt; <strong class="userinput"><code>UMASK_DIR=504  # = 770 in octal</code></strong>
shell&gt; <strong class="userinput"><code>export UMASK_DIR</code></strong>
shell&gt; <strong class="userinput"><code>mysqld_safe &amp;</code></strong>
</pre><p>
          In MySQL 3.23.25 and above, MySQL assumes that the value for
          <code class="literal">UMASK</code> and <code class="literal">UMASK_DIR</code> is
          in octal if it starts with a zero.
        </p><p>
          See <a href="installing.html#environment-variables" title="2.4.20. Environment Variables">Section 2.4.20, “Environment Variables”</a>.
        </p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="administration-issues"></a>B.1.4. Administration-Related Issues</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="error-handling.html#resetting-permissions">B.1.4.1. How to Reset the Root Password</a></span></dt><dt><span class="section"><a href="error-handling.html#crashing">B.1.4.2. What to Do If MySQL Keeps Crashing</a></span></dt><dt><span class="section"><a href="error-handling.html#full-disk">B.1.4.3. How MySQL Handles a Full Disk</a></span></dt><dt><span class="section"><a href="error-handling.html#temporary-files">B.1.4.4. Where MySQL Stores Temporary Files</a></span></dt><dt><span class="section"><a href="error-handling.html#problems-with-mysql-sock">B.1.4.5. How to Protect or Change the MySQL Unix Socket File</a></span></dt><dt><span class="section"><a href="error-handling.html#timezone-problems">B.1.4.6. Time Zone Problems</a></span></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="resetting-permissions"></a>B.1.4.1. How to Reset the Root Password</h4></div></div></div><div class="toc"><dl><dt><span class="section"><a href="error-handling.html#resetting-permissions-windows">B.1.4.1.1. Resetting the Root Password on Windows Systems</a></span></dt><dt><span class="section"><a href="error-handling.html#resetting-permissions-unix">B.1.4.1.2. Resetting the Root Password on Unix Systems</a></span></dt></dl></div><a class="indexterm" name="id3181905"></a><a class="indexterm" name="id3181917"></a><a class="indexterm" name="id3181929"></a><a class="indexterm" name="id3181942"></a><p>
          If you have never set a <code class="literal">root</code> password for
          MySQL, the server does not require a password at all for
          connecting as <code class="literal">root</code>. However, it is
          recommended to set a password for each account. See
          <a href="server-administration.html#security-guidelines" title="5.6.1. General Security Guidelines">Section 5.6.1, “General Security Guidelines”</a>.
        </p><p>
          If you set a <code class="literal">root</code> password previously, but
          have forgotten what it was, you can set a new password. The
          next two sections show procedures for Windows and Unix
          systems, respectively.
        </p><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="resetting-permissions-windows"></a>B.1.4.1.1. Resetting the Root Password on Windows Systems</h5></div></div></div><p>
            The procedure for resetting the MySQL root account's
            password on Windows is as follows:
          </p><div class="orderedlist"><ol type="1"><li><p>
                Log on to your system as Administrator.
              </p></li><li><p>
                Stop the MySQL server if it is running. For a server
                that is running as a Windows service, go to the Services
                manager:
              </p><pre class="programlisting">Start Menu -&gt; Control Panel -&gt; Administrative Tools -&gt; Services
</pre><p>
                Then find the MySQL service in the list, and stop it.
              </p><p>
                If your server is not running as a service, you may need
                to use the Task Manager to force it to stop.
              </p></li><li><p>
                Create a text file and place the following command
                within it on a single line:
              </p><pre class="programlisting">SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPassword');
</pre><p>
                Save the file with any name. For this example the file
                will be <code class="filename">C:\mysql-init.txt</code>.
              </p></li><li><p>
                Open a console window to get to the DOS command prompt:
              </p><pre class="programlisting">Start Menu -&gt; Run -&gt; cmd
</pre></li><li><p>
                We are assuming that you installed MySQL to
                <code class="filename">C:\mysql</code>. If you installed MySQL to
                another location, adjust the following commands
                accordingly.
              </p><p>
                At the DOS command prompt, execute this command:
              </p><pre class="programlisting">C:\&gt; <strong class="userinput"><code>C:\mysql\bin\mysqld-nt --init-file=C:\mysql-init.txt</code></strong>
</pre><p>
                The contents of the file named by the
                <code class="option">--init-file</code> option are executed at
                server startup, changing the <code class="literal">root</code>
                password. After the server has started successfully, you
                should delete <code class="filename">C:\mysql-init.txt</code>.
              </p><p>
                If you install MySQL using the MySQL Installation
                Wizard, you may need to specify a
                <code class="option">--defaults-file</code> option:
              </p><pre class="programlisting">C:\&gt; <strong class="userinput"><code>"C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt.exe"</code></strong>
         <strong class="userinput"><code>--defaults-file="C:\Program Files\MySQL\MySQL Server 5.0\my.ini"</code></strong>
         <strong class="userinput"><code>--init-file=C:\mysql-init.txt</code></strong>
</pre><p>
                The appropriate <code class="option">--defaults-file</code> setting
                can be found using the Services Manager:
              </p><pre class="programlisting">Start Menu -&gt; Control Panel -&gt; Administrative Tools -&gt; Services
</pre><p>
                Find the MySQL service in the list, right-click on it,
                and choose the <code class="literal">Properties</code> option. The
                <code class="literal">Path to executable</code> field contains the
                <code class="option">--defaults-file</code> setting.
              </p></li><li><p>
                Stop the MySQL server, then restart it in normal mode
                again. If you run the server as a service, start it from
                the Windows Services window. If you start the server
                manually, use whatever command you normally use.
              </p></li><li><p>
                You should be able to connect using the new password.
              </p></li></ol></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="resetting-permissions-unix"></a>B.1.4.1.2. Resetting the Root Password on Unix Systems</h5></div></div></div><p class="mnmas"><b>MySQL Enterprise</b>
              For expert advice on security-related issues, subscribe to
              the MySQL Enterprise Monitor. For more information, see
              <a href="http://www.mysql.com/products/enterprise/advisors.html" target="_top">http://www.mysql.com/products/enterprise/advisors.html</a>.
            </p><p>
            In a Unix environment, the procedure for resetting the MySQL
            <code class="literal">root</code> password is as follows:
          </p><div class="orderedlist"><ol type="1"><li><p>
                Log on to your system as either the Unix
                <code class="literal">root</code> user or as the same user that
                the <span><strong class="command">mysqld</strong></span> server runs as.
              </p></li><li><p>
                Locate the <code class="filename">.pid</code> file that contains
                the server's process ID. The exact location and name of
                this file depend on your distribution, hostname, and
                configuration. Common locations are
                <code class="filename">/var/lib/mysql/</code>,
                <code class="filename">/var/run/mysqld/</code>, and
                <code class="filename">/usr/local/mysql/data/</code>. Generally,
                the filename has the extension of
                <code class="filename">.pid</code> and begins with either
                <code class="filename">mysqld</code> or your system's hostname.
              </p><p>
                You can stop the MySQL server by sending a normal
                <code class="literal">kill</code> (not <code class="literal">kill -9</code>)
                to the <span><strong class="command">mysqld</strong></span> process, using the
                pathname of the <code class="filename">.pid</code> file in the
                following command:
              </p><pre class="programlisting">shell&gt; <strong class="userinput"><code>kill `cat /mysql-data-directory/host_name.pid`</code></strong>
</pre><p>
                Note the use of backticks rather than forward quotes
                with the <code class="literal">cat</code> command; these cause the
                output of <code class="literal">cat</code> to be substituted into
                the <code class="literal">kill</code> command.
              </p></li><li><p>
                Create a text file and place the following command
                within it on a single line:
              </p><pre class="programlisting">SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPassword');
</pre><p>
                Save the file with any name. For this example the file
                will be <code class="filename">~/mysql-init</code>.
              </p></li><li><p>
                Restart the MySQL server with the special
                <code class="option">--init-file=~/mysql-init</code> option:
              </p><pre class="programlisting">shell&gt; <strong class="userinput"><code>mysqld_safe --init-file=~/mysql-init &amp;</code></strong>
</pre><p>
                The contents of the init-file are executed at server
                startup, changing the root password. After the server
                has started successfully you should delete
                <code class="filename">~/mysql-init</code>.
              </p></li><li><p>
                You should be able to connect using the new password.
              </p></li></ol></div><p>
            Alternatively, on any platform, you can set the new password
            using the <span><strong class="command">mysql</strong></span> client(but this approach
            is less secure):
          </p><div class="orderedlist"><ol type="1"><li><p>
                Stop <span><strong class="command">mysqld</strong></span> and restart it with the
                <code class="option">--skip-grant-tables --user=root</code> options
                (Windows users omit the <code class="option">--user=root</code>
                portion).
              </p></li><li><p>
                Connect to the <span><strong class="command">mysqld</strong></span> server with
                this command:
              </p><pre class="programlisting">shell&gt; <strong class="userinput"><code>mysql -u root</code></strong>
</pre></li><li><p>
                Issue the following statements in the
                <span><strong class="command">mysql</strong></span> client:
              </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>UPDATE mysql.user SET Password=PASSWORD('<em class="replaceable"><code>newpwd</code></em>')</code></strong>
    -&gt;                   <strong class="userinput"><code>WHERE User='root';</code></strong>
mysql&gt; <strong class="userinput"><code>FLUSH PRIVILEGES;</code></strong>
</pre><p>
                Replace “<span class="quote"><em class="replaceable"><code>newpwd</code></em></span>”
                with the actual <code class="literal">root</code> password that
                you want to use.
              </p></li><li><p>
                You should be able to connect using the new password.
              </p></li></ol></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="crashing"></a>B.1.4.2. What to Do If MySQL Keeps Crashing</h4></div></div></div><a class="indexterm" name="id3182643"></a><p>
          Each MySQL version is tested on many platforms before it is
          released. This doesn't mean that there are no bugs in MySQL,
          but if there are bugs, they should be very few and can be hard
          to find. If you have a problem, it always helps if you try to
          find out exactly what crashes your system, because you have a
          much better chance of getting the problem fixed quickly.
        </p><p>
          First, you should try to find out whether the problem is that
          the <span><strong class="command">mysqld</strong></span> server dies or whether your
          problem has to do with your client. You can check how long
          your <span><strong class="command">mysqld</strong></span> server has been up by executing
          <span><strong class="command">mysqladmin version</strong></span>. If
          <span><strong class="command">mysqld</strong></span> has died and restarted, you may find
          the reason by looking in the server's error log. See
          <a href="server-administration.html#error-log" title="5.10.1. The Error Log">Section 5.10.1, “The Error Log”</a>.
        </p><p>
          On some systems, you can find in the error log a stack trace
          of where <span><strong class="command">mysqld</strong></span> died that you can resolve
          with the <code class="literal">resolve_stack_dump</code> program. See
          <a href="http://forge.mysql.com/wiki/MySQL_Internals_Porting" target="_top">MySQL
          Internals: Porting</a>. Note that the variable values
          written in the error log may not always be 100% correct.
        </p><p>
          Many server crashes are caused by corrupted data files or
          index files. MySQL updates the files on disk with the
          <code class="literal">write()</code> system call after every SQL
          statement and before the client is notified about the result.
          (This is not true if you are running with
          <code class="option">--delay-key-write</code>, in which case data files
          are written but not index files.) This means that data file
          contents are safe even if <span><strong class="command">mysqld</strong></span> crashes,
          because the operating system ensures that the unflushed data
          is written to disk. You can force MySQL to flush everything to
          disk after every SQL statement by starting
          <span><strong class="command">mysqld</strong></span> with the <code class="option">--flush</code>
          option.
        </p><p>
          The preceding means that normally you should not get corrupted
          tables unless one of the following happens:
        </p><div class="itemizedlist"><ul type="disc"><li><p>
              The MySQL server or the server host was killed in the
              middle of an update.
            </p></li><li><p>
              You have found a bug in <span><strong class="command">mysqld</strong></span> that
              caused it to die in the middle of an update.
            </p></li><li><p>
              Some external program is manipulating data files or index
              files at the same time as <span><strong class="command">mysqld</strong></span>
              without locking the table properly.
            </p></li><li><p>
              You are running many <span><strong class="command">mysqld</strong></span> servers
              using the same data directory on a system that doesn't
              support good filesystem locks (normally handled by the
              <code class="literal">lockd</code> lock manager), or you are running
              multiple servers with external locking disabled.
            </p></li><li><p>
              You have a crashed data file or index file that contains
              very corrupt data that confused <span><strong class="command">mysqld</strong></span>.
            </p></li><li><p>
              You have found a bug in the data storage code. This isn't
              likely, but it's at least possible. In this case, you can
              try to change the storage engine to another engine by
              using <code class="literal">ALTER TABLE</code> on a repaired copy of
              the table.
            </p></li></ul></div><p>
          Because it is very difficult to know why something is
          crashing, first try to check whether things that work for
          others crash for you. Please try the following things:
        </p><div class="itemizedlist"><ul type="disc"><li><p>
              Stop the <span><strong class="command">mysqld</strong></span> server with
              <span><strong class="command">mysqladmin shutdown</strong></span>, run
              <span><strong class="command">myisamchk --silent --force */*.MYI</strong></span> from
              the data directory to check all <code class="literal">MyISAM</code>
              tables, and restart <span><strong class="command">mysqld</strong></span>. This
              ensures that you are running from a clean state. See
              <a href="server-administration.html" title="Chapter 5. MySQL Server Administration">Chapter 5, <i>MySQL Server Administration</i></a>.
            </p></li><li><p>
              Start <span><strong class="command">mysqld</strong></span> with the
              <code class="option">--log</code> option and try to determine from
              the information written to the log whether some specific
              query kills the server. About 95% of all bugs are related
              to a particular query. Normally, this is one of the last
              queries in the log file just before the server restarts.
              See <a href="server-administration.html#query-log" title="5.10.2. The General Query Log">Section 5.10.2, “The General Query Log”</a>. If you can repeatedly
              kill MySQL with a specific query, even when you have
              checked all tables just before issuing it, then you have
              been able to locate the bug and should submit a bug report
              for it. See <a href="introduction.html#bug-reports" title="1.7. How to Report Bugs or Problems">Section 1.7, “How to Report Bugs or Problems”</a>.
            </p></li><li><p>
              Try to make a test case that we can use to repeat the
              problem. See
              <a href="http://forge.mysql.com/wiki/MySQL_Internals_Porting" target="_top">MySQL
              Internals: Porting</a>.
            </p></li><li><p>
              Try running the tests in the
              <code class="filename">mysql-test</code> directory and the MySQL
              benchmarks. See <a href="extending-mysql.html#mysql-test-suite" title="26.1.2. MySQL Test Suite">Section 26.1.2, “MySQL Test Suite”</a>. They
              should test MySQL rather well. You can also add code to
              the benchmarks that simulates your application. The
              benchmarks can be found in the
              <code class="filename">sql-bench</code> directory in a source
              distribution or, for a binary distribution, in the
              <code class="filename">sql-bench</code> directory under your MySQL
              installation directory.
            </p></li><li><p>
              Try the <code class="literal">fork_big.pl</code> script. (It is
              located in the <code class="filename">tests</code> directory of
              source distributions.)
            </p></li><li><p>
              If you configure MySQL for debugging, it is much easier to
              gather information about possible errors if something goes
              wrong. Configuring MySQL for debugging causes a safe
              memory allocator to be included that can find some errors.
              It also provides a lot of output about what is happening.
              Reconfigure MySQL with the <code class="option">--with-debug</code>
              or <code class="option">--with-debug=full</code> option to
              <span><strong class="command">configure</strong></span> and then recompile. See
              <a href="http://forge.mysql.com/wiki/MySQL_Internals_Porting" target="_top">MySQL
              Internals: Porting</a>.
            </p></li><li><p>
              Make sure that you have applied the latest patches for
              your operating system.
            </p></li><li><p>
              Use the <code class="option">--skip-external-locking</code> option to
              <span><strong class="command">mysqld</strong></span>. On some systems, the
              <code class="literal">lockd</code> lock manager does not work
              properly; the <code class="option">--skip-external-locking</code>
              option tells <span><strong class="command">mysqld</strong></span> not to use external
              locking. (This means that you cannot run two
              <span><strong class="command">mysqld</strong></span> servers on the same data
              directory and that you must be careful if you use
              <span><strong class="command">myisamchk</strong></span>. Nevertheless, it may be
              instructive to try the option as a test.)
            </p></li><li><p>
              Have you tried <span><strong class="command">mysqladmin -u root
              processlist</strong></span> when <span><strong class="command">mysqld</strong></span>
              appears to be running but not responding? Sometimes
              <span><strong class="command">mysqld</strong></span> is not comatose even though you
              might think so. The problem may be that all connections
              are in use, or there may be some internal lock problem.
              <span><strong class="command">mysqladmin -u root processlist</strong></span> usually
              is able to make a connection even in these cases, and can
              provide useful information about the current number of
              connections and their status.
            </p></li><li><p>
              Run the command <span><strong class="command">mysqladmin -i 5 status</strong></span>
              or <span><strong class="command">mysqladmin -i 5 -r status</strong></span> in a
              separate window to produce statistics while you run your
              other queries.
            </p></li><li><p>
              Try the following:
            </p><div class="orderedlist"><ol type="1"><li><p>
                  Start <span><strong class="command">mysqld</strong></span> from
                  <span><strong class="command">gdb</strong></span> (or another debugger). See
                  <a href="http://forge.mysql.com/wiki/MySQL_Internals_Porting" target="_top">MySQL
                  Internals: Porting</a>.
                </p></li><li><p>
                  Run your test scripts.
                </p></li><li><p>
                  Print the backtrace and the local variables at the
                  three lowest levels. In <span><strong class="command">gdb</strong></span>, you
                  can do this with the following commands when
                  <span><strong class="command">mysqld</strong></span> has crashed inside
                  <span><strong class="command">gdb</strong></span>:
                </p><pre class="programlisting">backtrace
info local
up
info local
up
info local
</pre><p>
                  With <span><strong class="command">gdb</strong></span>, you can also examine
                  which threads exist with <code class="literal">info
                  threads</code> and switch to a specific thread with
                  <code class="literal">thread
                  <em class="replaceable"><code>N</code></em></code>, where
                  <em class="replaceable"><code>N</code></em> is the thread ID.
                </p></li></ol></div></li><li><p>
              Try to simulate your application with a Perl script to
              force MySQL to crash or misbehave.
            </p></li><li><p>
              Send a normal bug report. See
              <a href="introduction.html#bug-reports" title="1.7. How to Report Bugs or Problems">Section 1.7, “How to Report Bugs or Problems”</a>. Be even more detailed than
              usual. Because MySQL works for many people, it may be that
              the crash results from something that exists only on your
              computer (for example, an error that is related to your
              particular system libraries).
            </p></li><li><p>
              If you have a problem with tables containing
              dynamic-length rows and you are using only
              <code class="literal">VARCHAR</code> columns (not
              <code class="literal">BLOB</code> or <code class="literal">TEXT</code>
              columns), you can try to change all
              <code class="literal">VARCHAR</code> to <code class="literal">CHAR</code> with
              <code class="literal">ALTER TABLE</code>. This forces MySQL to use
              fixed-size rows. Fixed-size rows take a little extra
              space, but are much more tolerant to corruption.
            </p><p>
              The current dynamic row code has been in use at MySQL AB
              for several years with very few problems, but
              dynamic-length rows are by nature more prone to errors, so
              it may be a good idea to try this strategy to see whether
              it helps.
            </p></li><li><p>
              Do not rule out your server hardware when diagnosing
              problems. Defective hardware can be the cause of data
              corruption. Particular attention should be paid to both
              RAMS and hard-drives when troubleshooting hardware.
            </p></li></ul></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="full-disk"></a>B.1.4.3. How MySQL Handles a Full Disk</h4></div></div></div><a class="indexterm" name="id3183412"></a><a class="indexterm" name="id3183421"></a><p>
          This section describes how MySQL responds to disk-full errors
          (such as “<span class="quote">no space left on device</span>”), and to
          quota-exceeded errors (such as “<span class="quote">write failed</span>” or
          “<span class="quote">user block limit reached</span>”).
        </p><p>
          This section is relevant for writes to
          <code class="literal">MyISAM</code> tables. It also applies for writes
          to binary log files and binary log index file, except that
          references to “<span class="quote">row</span>” and “<span class="quote">record</span>”
          should be understood to mean “<span class="quote">event.</span>”
        </p><p>
          When a disk-full condition occurs, MySQL does the following:
        </p><div class="itemizedlist"><ul type="disc"><li><p>
              It checks once every minute to see whether there is enough
              space to write the current row. If there is enough space,
              it continues as if nothing had happened.
            </p></li><li><p>
              Every 10 minutes it writes an entry to the log file,
              warning about the disk-full condition.
            </p></li></ul></div><p>
          To alleviate the problem, you can take the following actions:
        </p><div class="itemizedlist"><ul type="disc"><li><p>
              To continue, you only have to free enough disk space to
              insert all records.
            </p></li><li><p>
              To abort the thread, you must use <span><strong class="command">mysqladmin
              kill</strong></span>. The thread is aborted the next time it
              checks the disk (in one minute).
            </p></li><li><p>
              Other threads might be waiting for the table that caused
              the disk-full condition. If you have several
              “<span class="quote">locked</span>” threads, killing the one thread that
              is waiting on the disk-full condition allows the other
              threads to continue.
            </p></li></ul></div><p>
          Exceptions to the preceding behavior are when you use
          <code class="literal">REPAIR TABLE</code> or <code class="literal">OPTIMIZE
          TABLE</code> or when the indexes are created in a batch
          after <code class="literal">LOAD DATA INFILE</code> or after an
          <code class="literal">ALTER TABLE</code> statement. All of these
          statements may create large temporary files that, if left to
          themselves, would cause big problems for the rest of the
          system. If the disk becomes full while MySQL is doing any of
          these operations, it removes the big temporary files and mark
          the table as crashed. The exception is that for <code class="literal">ALTER
          TABLE</code>, the old table is left unchanged.
        </p><p class="mnmas"><b>MySQL Enterprise</b>
            For early notification of possible problems with your MySQL
            configuration subscribe to the MySQL Enterprise Monitor. For
            more information, see
            <a href="http://www.mysql.com/products/enterprise/advisors.html" target="_top">http://www.mysql.com/products/enterprise/advisors.html</a>.
          </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="temporary-files"></a>B.1.4.4. Where MySQL Stores Temporary Files</h4></div></div></div><p>
          MySQL uses the value of the <code class="literal">TMPDIR</code>
          environment variable as the pathname of the directory in which
          to store temporary files. If you don't have
          <code class="literal">TMPDIR</code> set, MySQL uses the system default,
          which is normally <code class="filename">/tmp</code>,
          <code class="filename">/var/tmp</code>, or
          <code class="filename">/usr/tmp</code>. If the filesystem containing
          your temporary file directory is too small, you can use the
          <code class="option">--tmpdir</code> option to <span><strong class="command">mysqld</strong></span>
          to specify a directory in a filesystem where you have enough
          space.
        </p><p>
          In MySQL 5.0, the <code class="option">--tmpdir</code>
          option can be set to a list of several paths that are used in
          round-robin fashion. Paths should be separated by colon
          characters (“<span class="quote"><code class="literal">:</code></span>”) on Unix and
          semicolon characters (“<span class="quote"><code class="literal">;</code></span>”) on
          Windows, NetWare, and OS/2.
        </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
            To spread the load effectively, these paths should be
            located on different <span class="emphasis"><em>physical</em></span> disks,
            not different partitions of the same disk.
          </p></div><p>
          If the MySQL server is acting as a replication slave, you
          should not set <code class="option">--tmpdir</code> to point to a
          directory on a memory-based filesystem or to a directory that
          is cleared when the server host restarts. A replication slave
          needs some of its temporary files to survive a machine restart
          so that it can replicate temporary tables or <code class="literal">LOAD
          DATA INFILE</code> operations. If files in the temporary
          file directory are lost when the server restarts, replication
          fails.
        </p><p>
          MySQL creates all temporary files as hidden files. This
          ensures that the temporary files are removed if
          <span><strong class="command">mysqld</strong></span> is terminated. The disadvantage of
          using hidden files is that you do not see a big temporary file
          that fills up the filesystem in which the temporary file
          directory is located.
        </p><p class="mnmas"><b>MySQL Enterprise</b>
            Advisors provided by the MySQL Enterprise Monitor
            automatically detect excessive temporary table storage to
            disk. For more information, see
            <a href="http://www.mysql.com/products/enterprise/advisors.html" target="_top">http://www.mysql.com/products/enterprise/advisors.html</a>.
          </p><p>
          When sorting (<code class="literal">ORDER BY</code> or <code class="literal">GROUP
          BY</code>), MySQL normally uses one or two temporary files.
          The maximum disk space required is determined by the following
          expression:
        </p><pre class="programlisting">(length of what is sorted + sizeof(row pointer))
* number of matched rows
* 2
</pre><p>
          The row pointer size is usually four bytes, but may grow in
          the future for really big tables.
        </p><p>
          For some <code class="literal">SELECT</code> queries, MySQL also creates
          temporary SQL tables. These are not hidden and have names of
          the form <code class="filename">SQL_*</code>.
        </p><p>
          <code class="literal">ALTER TABLE</code> creates a temporary table in
          the same directory as the original table.
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="problems-with-mysql-sock"></a>B.1.4.5. How to Protect or Change the MySQL Unix Socket File</h4></div></div></div><a class="indexterm" name="id3183834"></a><a class="indexterm" name="id3183846"></a><p>
          The default location for the Unix socket file that the server
          uses for communication with local clients is
          <code class="filename">/tmp/mysql.sock</code>. (For some distribution
          formats, the directory might be different, such as
          <code class="filename">/var/lib/mysql</code> for RPMs.)
        </p><p>
          On some versions of Unix, anyone can delete files in the
          <code class="filename">/tmp</code> directory or other similar
          directories used for temporary files. If the socket file is
          located in such a directory on your system, this might cause
          problems.
        </p><p>
          On most versions of Unix, you can protect your
          <code class="filename">/tmp</code> directory so that files can be
          deleted only by their owners or the superuser
          (<code class="literal">root</code>). To do this, set the
          <code class="literal">sticky</code> bit on the <code class="filename">/tmp</code>
          directory by logging in as <code class="literal">root</code> and using
          the following command:
        </p><pre class="programlisting">shell&gt; <strong class="userinput"><code>chmod +t /tmp</code></strong>
</pre><p>
          You can check whether the <code class="literal">sticky</code> bit is set
          by executing <code class="literal">ls -ld /tmp</code>. If the last
          permission character is <code class="literal">t</code>, the bit is set.
        </p><a class="indexterm" name="id3183965"></a><p>
          Another approach is to change the place where the server
          creates the Unix socket file. If you do this, you should also
          let client programs know the new location of the file. You can
          specify the file location in several ways:
        </p><div class="itemizedlist"><ul type="disc"><li><p>
              Specify the path in a global or local option file. For
              example, put the following lines in
              <code class="literal">/etc/my.cnf</code>:
            </p><pre class="programlisting">[mysqld]
socket=/path/to/socket

[client]
socket=/path/to/socket
</pre><p>
              See <a href="using-mysql-programs.html#option-files" title="4.3.2. Using Option Files">Section 4.3.2, “Using Option Files”</a>.
            </p></li><li><p>
              Specify a <code class="option">--socket</code> option on the command
              line to <span><strong class="command">mysqld_safe</strong></span> and when you run
              client programs.
            </p></li><li><p>
              Set the <code class="literal">MYSQL_UNIX_PORT</code> environment
              variable to the path of the Unix socket file.
            </p></li><li><p>
              Recompile MySQL from source to use a different default
              Unix socket file location. Define the path to the file
              with the <code class="option">--with-unix-socket-path</code> option
              when you run <span><strong class="command">configure</strong></span>. See
              <a href="installing.html#configure-options" title="2.4.15.2. Typical configure Options">Section 2.4.15.2, “Typical <span><strong class="command">configure</strong></span> Options”</a>.
            </p></li></ul></div><p>
          You can test whether the new socket location works by
          attempting to connect to the server with this command:
        </p><pre class="programlisting">shell&gt; <strong class="userinput"><code>mysqladmin --socket=/path/to/socket version</code></strong>
</pre></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="timezone-problems"></a>B.1.4.6. Time Zone Problems</h4></div></div></div><a class="indexterm" name="id3184100"></a><a class="indexterm" name="id3184109"></a><a class="indexterm" name="id3184121"></a><a class="indexterm" name="id3184130"></a><p>
          If you have a problem with <code class="literal">SELECT NOW()</code>
          returning values in UTC and not your local time, you have to
          tell the server your current time zone. The same applies if
          <code class="literal">UNIX_TIMESTAMP()</code> returns the wrong value.
          This should be done for the environment in which the server
          runs; for example, in <span><strong class="command">mysqld_safe</strong></span> or
          <span><strong class="command">mysql.server</strong></span>. See
          <a href="installing.html#environment-variables" title="2.4.20. Environment Variables">Section 2.4.20, “Environment Variables”</a>.
        </p><p>
          You can set the time zone for the server with the
          <code class="option">--timezone=<em class="replaceable"><code>timezone_name</code></em></code>
          option to <span><strong class="command">mysqld_safe</strong></span>. You can also set it
          by setting the <code class="literal">TZ</code> environment variable
          before you start <span><strong class="command">mysqld</strong></span>.
        </p><p>
          The allowable values for <code class="option">--timezone</code> or
          <code class="literal">TZ</code> are system-dependent. Consult your
          operating system documentation to see what values are
          acceptable.
        </p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="query-issues"></a>B.1.5. Query-Related Issues</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="error-handling.html#case-sensitivity">B.1.5.1. Case Sensitivity in Searches</a></span></dt><dt><span class="section"><a href="error-handling.html#using-date">B.1.5.2. Problems Using <code class="literal">DATE</code> Columns</a></span></dt><dt><span class="section"><a href="error-handling.html#problems-with-null">B.1.5.3. Problems with <code class="literal">NULL</code> Values</a></span></dt><dt><span class="section"><a href="error-handling.html#problems-with-alias">B.1.5.4. Problems with Column Aliases</a></span></dt><dt><span class="section"><a href="error-handling.html#non-transactional-tables">B.1.5.5. Rollback Failure for Non-Transactional Tables</a></span></dt><dt><span class="section"><a href="error-handling.html#deleting-from-related-tables">B.1.5.6. Deleting Rows from Related Tables</a></span></dt><dt><span class="section"><a href="error-handling.html#no-matching-rows">B.1.5.7. Solving Problems with No Matching Rows</a></span></dt><dt><span class="section"><a href="error-handling.html#problems-with-float">B.1.5.8. Problems with Floating-Point Comparisons</a></span></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="case-sensitivity"></a>B.1.5.1. Case Sensitivity in Searches</h4></div></div></div><a class="indexterm" name="id3184245"></a><a class="indexterm" name="id3184258"></a><a class="indexterm" name="id3184271"></a><a class="indexterm" name="id3184280"></a><p>
          By default, MySQL searches are not case sensitive. This means
          that if you search with
          <code class="literal"><em class="replaceable"><code>col_name</code></em> LIKE
          'a%'</code>, you get all column values that start with
          <code class="literal">A</code> or <code class="literal">a</code>. If you want to
          make this search case sensitive, make sure that one of the
          operands has a case sensitive or binary collation. For
          example, if you are comparing a column and a string that both
          have the <code class="literal">latin1</code> character set, you can use
          the <code class="literal">COLLATE</code> operator to cause either
          operand to have the <code class="literal">latin1_general_cs</code> or
          <code class="literal">latin1_bin</code> collation. For example:
        </p><pre class="programlisting"><em class="replaceable"><code>col_name</code></em> COLLATE latin1_general_cs LIKE 'a%'
<em class="replaceable"><code>col_name</code></em> LIKE 'a%' COLLATE latin1_general_cs
<em class="replaceable"><code>col_name</code></em> COLLATE latin1_bin LIKE 'a%'
<em class="replaceable"><code>col_name</code></em> LIKE 'a%' COLLATE latin1_bin
</pre><p>
          If you want a column always to be treated in case-sensitive
          fashion, declare it with a case sensitive or binary collation.
          See <a href="sql-syntax.html#create-table" title="12.1.5. CREATE TABLE Syntax">Section 12.1.5, “<code class="literal">CREATE TABLE</code> Syntax”</a>.
        </p><p>
          Simple comparison operations (<code class="literal">&gt;=, &gt;, =, &lt;,
          &lt;=</code>, sorting, and grouping) are based on each
          character's “<span class="quote">sort value.</span>” Characters with the
          same sort value (such as “<span class="quote"><code class="literal">E</code></span>”,
          “<span class="quote"><code class="literal">e</code></span>”, and
          “<span class="quote"><code class="literal">é</code></span>”) are treated as the
          same character.
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="using-date"></a>B.1.5.2. Problems Using <code class="literal">DATE</code> Columns</h4></div></div></div><a class="indexterm" name="id3184430"></a><a class="indexterm" name="id3184439"></a><a class="indexterm" name="id3184451"></a><p>
          The format of a <code class="literal">DATE</code> value is
          <code class="literal">'YYYY-MM-DD'</code>. According to standard SQL, no
          other format is allowed. You should use this format in
          <code class="literal">UPDATE</code> expressions and in the
          <code class="literal">WHERE</code> clause of <code class="literal">SELECT</code>
          statements. For example:
        </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>SELECT * FROM <em class="replaceable"><code>tbl_name</code></em> WHERE date &gt;= '2003-05-05';</code></strong>
</pre><p>
          As a convenience, MySQL automatically converts a date to a
          number if the date is used in a numeric context (and vice
          versa). It is also smart enough to allow a
          “<span class="quote">relaxed</span>” string form when updating and in a
          <code class="literal">WHERE</code> clause that compares a date to a
          <code class="literal">TIMESTAMP</code>, <code class="literal">DATE</code>, or
          <code class="literal">DATETIME</code> column. (“<span class="quote">Relaxed
          form</span>” means that any punctuation character may be used
          as the separator between parts. For example,
          <code class="literal">'2004-08-15'</code> and
          <code class="literal">'2004#08#15'</code> are equivalent.) MySQL can
          also convert a string containing no separators (such as
          <code class="literal">'20040815'</code>), provided it makes sense as a
          date.
        </p><p>
          When you compare a <code class="literal">DATE</code>,
          <code class="literal">TIME</code>, <code class="literal">DATETIME</code>, or
          <code class="literal">TIMESTAMP</code> to a constant string with the
          <code class="literal">&lt;</code>, <code class="literal">&lt;=</code>,
          <code class="literal">=</code>, <code class="literal">&gt;=</code>,
          <code class="literal">&gt;</code>, or <code class="literal">BETWEEN</code>
          operators, MySQL normally converts the string to an internal
          long integer for faster comparison (and also for a bit more
          “<span class="quote">relaxed</span>” string checking). However, this
          conversion is subject to the following exceptions:
        </p><div class="itemizedlist"><ul type="disc"><li><p>
              When you compare two columns
            </p></li><li><p>
              When you compare a <code class="literal">DATE</code>,
              <code class="literal">TIME</code>, <code class="literal">DATETIME</code>, or
              <code class="literal">TIMESTAMP</code> column to an expression
            </p></li><li><p>
              When you use any other comparison method than those just
              listed, such as <code class="literal">IN</code> or
              <a href="functions.html#function_strcmp"><code class="literal">STRCMP()</code></a>.
            </p></li></ul></div><p>
          For these exceptional cases, the comparison is done by
          converting the objects to strings and performing a string
          comparison.
        </p><p>
          To keep things safe, assume that strings are compared as
          strings and use the appropriate string functions if you want
          to compare a temporal value to a string.
        </p><p>
          The special date <code class="literal">'0000-00-00'</code> can be stored
          and retrieved as <code class="literal">'0000-00-00'.</code> When using a
          <code class="literal">'0000-00-00'</code> date through MyODBC, it is
          automatically converted to <code class="literal">NULL</code> in MyODBC
          2.50.12 and above, because ODBC can't handle this kind of
          date.
        </p><p>
          Because MySQL performs the conversions described above, the
          following statements work:
        </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>INSERT INTO <em class="replaceable"><code>tbl_name</code></em> (idate) VALUES (19970505);</code></strong>
mysql&gt; <strong class="userinput"><code>INSERT INTO <em class="replaceable"><code>tbl_name</code></em> (idate) VALUES ('19970505');</code></strong>
mysql&gt; <strong class="userinput"><code>INSERT INTO <em class="replaceable"><code>tbl_name</code></em> (idate) VALUES ('97-05-05');</code></strong>
mysql&gt; <strong class="userinput"><code>INSERT INTO <em class="replaceable"><code>tbl_name</code></em> (idate) VALUES ('1997.05.05');</code></strong>
mysql&gt; <strong class="userinput"><code>INSERT INTO <em class="replaceable"><code>tbl_name</code></em> (idate) VALUES ('1997 05 05');</code></strong>
mysql&gt; <strong class="userinput"><code>INSERT INTO <em class="replaceable"><code>tbl_name</code></em> (idate) VALUES ('0000-00-00');</code></strong>

mysql&gt; <strong class="userinput"><code>SELECT idate FROM <em class="replaceable"><code>tbl_name</code></em> WHERE idate &gt;= '1997-05-05';</code></strong>
mysql&gt; <strong class="userinput"><code>SELECT idate FROM <em class="replaceable"><code>tbl_name</code></em> WHERE idate &gt;= 19970505;</code></strong>
mysql&gt; <strong class="userinput"><code>SELECT MOD(idate,100) FROM <em class="replaceable"><code>tbl_name</code></em> WHERE idate &gt;= 19970505;</code></strong>
mysql&gt; <strong class="userinput"><code>SELECT idate FROM <em class="replaceable"><code>tbl_name</code></em> WHERE idate &gt;= '19970505';</code></strong>
</pre><p>
          However, the following does not work:
        </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>SELECT idate FROM <em class="replaceable"><code>tbl_name</code></em> WHERE STRCMP(idate,'20030505')=0;</code></strong>
</pre><p>
          <a href="functions.html#function_strcmp"><code class="literal">STRCMP()</code></a> is a string function,
          so it converts <code class="literal">idate</code> to a string in
          <code class="literal">'YYYY-MM-DD'</code> format and performs a string
          comparison. It does not convert <code class="literal">'20030505'</code>
          to the date <code class="literal">'2003-05-05'</code> and perform a date
          comparison.
        </p><p>
          If you are using the <code class="literal">ALLOW_INVALID_DATES</code>
          SQL mode, MySQL allows you to store dates that are given only
          limited checking: MySQL requires only that the day is in the
          range from 1 to 31 and the month is in the range from 1 to 12.
        </p><p>
          This makes MySQL very convenient for Web applications where
          you obtain year, month, and day in three different fields and
          you want to store exactly what the user inserted (without date
          validation).
        </p><p>
          If you are not using the <code class="literal">NO_ZERO_IN_DATE</code>
          SQL mode, the day or month part can be zero. This is
          convenient if you want to store a birthdate in a
          <code class="literal">DATE</code> column and you know only part of the
          date.
        </p><p>
          If you are not using the <code class="literal">NO_ZERO_DATE</code> SQL
          mode, MySQL also allows you to store
          <code class="literal">'0000-00-00'</code> as a “<span class="quote">dummy
          date.</span>” This is in some cases more convenient than using
          <code class="literal">NULL</code> values.
        </p><p>
          If the date cannot be converted to any reasonable value, a
          <code class="literal">0</code> is stored in the <code class="literal">DATE</code>
          column, which is retrieved as <code class="literal">'0000-00-00'</code>.
          This is both a speed and a convenience issue. We believe that
          the database server's responsibility is to retrieve the same
          date you stored (even if the data was not logically correct in
          all cases). We think it is up to the application and not the
          server to check the dates.
        </p><p>
          If you want MySQL to check all dates and accept only legal
          dates (unless overridden by IGNORE), you should set
          <code class="literal">sql_mode</code> to
          <code class="literal">"NO_ZERO_IN_DATE,NO_ZERO_DATE"</code>.
        </p><p>
          Date handling in MySQL 5.0.1 and earlier works like MySQL
          5.0.2 with the <code class="literal">ALLOW_INVALID_DATES</code> SQL mode
          enabled.
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="problems-with-null"></a>B.1.5.3. Problems with <code class="literal">NULL</code> Values</h4></div></div></div><a class="indexterm" name="id3185074"></a><a class="indexterm" name="id3185087"></a><p>
          The concept of the <code class="literal">NULL</code> value is a common
          source of confusion for newcomers to SQL, who often think that
          <code class="literal">NULL</code> is the same thing as an empty string
          <code class="literal">''</code>. This is not the case. For example, the
          following statements are completely different:
        </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>INSERT INTO my_table (phone) VALUES (NULL);</code></strong>
mysql&gt; <strong class="userinput"><code>INSERT INTO my_table (phone) VALUES ('');</code></strong>
</pre><p>
          Both statements insert a value into the
          <code class="literal">phone</code> column, but the first inserts a
          <code class="literal">NULL</code> value and the second inserts an empty
          string. The meaning of the first can be regarded as
          “<span class="quote">phone number is not known</span>” and the meaning of
          the second can be regarded as “<span class="quote">the person is known to
          have no phone, and thus no phone number.</span>”
        </p><p>
          To help with <code class="literal">NULL</code> handling, you can use the
          <a href="functions.html#operator_is-null"><code class="literal">IS NULL</code></a> and
          <a href="functions.html#operator_is-not-null"><code class="literal">IS NOT NULL</code></a> operators and
          the <a href="functions.html#function_ifnull"><code class="literal">IFNULL()</code></a> function.
        </p><p>
          In SQL, the <code class="literal">NULL</code> value is never true in
          comparison to any other value, even <code class="literal">NULL</code>.
          An expression that contains <code class="literal">NULL</code> always
          produces a <code class="literal">NULL</code> value unless otherwise
          indicated in the documentation for the operators and functions
          involved in the expression. All columns in the following
          example return <code class="literal">NULL</code>:
        </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>SELECT NULL, 1+NULL, CONCAT('Invisible',NULL);</code></strong>
</pre><p>
          If you want to search for column values that are
          <code class="literal">NULL</code>, you cannot use an <code class="literal">expr =
          NULL</code> test. The following statement returns no rows,
          because <code class="literal">expr = NULL</code> is never true for any
          expression:
        </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>SELECT * FROM my_table WHERE phone = NULL;</code></strong>
</pre><p>
          To look for <code class="literal">NULL</code> values, you must use the
          <a href="functions.html#operator_is-null"><code class="literal">IS NULL</code></a> test. The following
          statements show how to find the <code class="literal">NULL</code> phone
          number and the empty phone number:
        </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>SELECT * FROM my_table WHERE phone IS NULL;</code></strong>
mysql&gt; <strong class="userinput"><code>SELECT * FROM my_table WHERE phone = '';</code></strong>
</pre><p>
          See <a href="tutorial.html#working-with-null" title="3.3.4.6. Working with NULL Values">Section 3.3.4.6, “Working with <code class="literal">NULL</code> Values”</a>, for additional
          information and examples.
        </p><p>
          You can add an index on a column that can have
          <code class="literal">NULL</code> values if you are using the
          <code class="literal">MyISAM</code>, <code class="literal">InnoDB</code>, or
          <code class="literal">BDB</code>, or <code class="literal">MEMORY</code> storage
          engine. Otherwise, you must declare an indexed column
          <code class="literal">NOT NULL</code>, and you cannot insert
          <code class="literal">NULL</code> into the column.
        </p><a class="indexterm" name="id3185392"></a><p>
          When reading data with <code class="literal">LOAD DATA INFILE</code>,
          empty or missing columns are updated with
          <code class="literal">''</code>. If you want a <code class="literal">NULL</code>
          value in a column, you should use <code class="literal">\N</code> in the
          data file. The literal word
          “<span class="quote"><code class="literal">NULL</code></span>” may also be used under
          some circumstances. See <a href="sql-syntax.html#load-data" title="12.2.5. LOAD DATA INFILE Syntax">Section 12.2.5, “<code class="literal">LOAD DATA INFILE</code> Syntax”</a>.
        </p><p>
          When using <code class="literal">DISTINCT</code>, <code class="literal">GROUP
          BY</code>, or <code class="literal">ORDER BY</code>, all
          <code class="literal">NULL</code> values are regarded as equal.
        </p><p>
          When using <code class="literal">ORDER BY</code>,
          <code class="literal">NULL</code> values are presented first, or last if
          you specify <code class="literal">DESC</code> to sort in descending
          order.
        </p><p>
          Aggregate (summary) functions such as
          <a href="functions.html#function_count"><code class="literal">COUNT()</code></a>,
          <a href="functions.html#function_min"><code class="literal">MIN()</code></a>, and
          <a href="functions.html#function_sum"><code class="literal">SUM()</code></a> ignore
          <code class="literal">NULL</code> values. The exception to this is
          <a href="functions.html#function_count"><code class="literal">COUNT(*)</code></a>, which counts rows
          and not individual column values. For example, the following
          statement produces two counts. The first is a count of the
          number of rows in the table, and the second is a count of the
          number of non-<code class="literal">NULL</code> values in the
          <code class="literal">age</code> column:
        </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>SELECT COUNT(*), COUNT(age) FROM person;</code></strong>
</pre><a class="indexterm" name="id3185564"></a><a class="indexterm" name="id3185576"></a><a class="indexterm" name="id3185589"></a><a class="indexterm" name="id3185601"></a><p>
          For some data types, MySQL handles <code class="literal">NULL</code>
          values specially. If you insert <code class="literal">NULL</code> into a
          <code class="literal">TIMESTAMP</code> column, the current date and time
          is inserted. If you insert <code class="literal">NULL</code> into an
          integer or floating-point column that has the
          <code class="literal">AUTO_INCREMENT</code> attribute, the next number
          in the sequence is inserted.
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="problems-with-alias"></a>B.1.5.4. Problems with Column Aliases</h4></div></div></div><a class="indexterm" name="id3185662"></a><p>
          You can use an alias to refer to a column in <code class="literal">GROUP
          BY</code>, <code class="literal">ORDER BY</code>, or
          <code class="literal">HAVING</code> clauses. Aliases can also be used to
          give columns better names:
        </p><pre class="programlisting">SELECT SQRT(a*b) AS root FROM <em class="replaceable"><code>tbl_name</code></em> GROUP BY root HAVING root &gt; 0;
SELECT id, COUNT(*) AS cnt FROM <em class="replaceable"><code>tbl_name</code></em> GROUP BY id HAVING cnt &gt; 0;
SELECT id AS 'Customer identity' FROM <em class="replaceable"><code>tbl_name</code></em>;
</pre><p>
          Standard SQL doesn't allow you to refer to a column alias in a
          <code class="literal">WHERE</code> clause. This restriction is imposed
          because when the <code class="literal">WHERE</code> code is executed,
          the column value may not yet be determined. For example, the
          following query is illegal:
        </p><pre class="programlisting">SELECT id, COUNT(*) AS cnt FROM <em class="replaceable"><code>tbl_name</code></em> WHERE cnt &gt; 0 GROUP BY id;
</pre><p>
          The <code class="literal">WHERE</code> statement is executed to
          determine which rows should be included in the <code class="literal">GROUP
          BY</code> part, whereas <code class="literal">HAVING</code> is used
          to decide which rows from the result set should be used.
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="non-transactional-tables"></a>B.1.5.5. Rollback Failure for Non-Transactional Tables</h4></div></div></div><a class="indexterm" name="id3185782"></a><p>
          If you receive the following message when trying to perform a
          <code class="literal">ROLLBACK</code>, it means that one or more of the
          tables you used in the transaction do not support
          transactions:
        </p><pre class="programlisting">Warning: Some non-transactional changed tables couldn't be rolled back
</pre><p>
          These non-transactional tables are not affected by the
          <code class="literal">ROLLBACK</code> statement.
        </p><p>
          If you were not deliberately mixing transactional and
          non-transactional tables within the transaction, the most
          likely cause for this message is that a table you thought was
          transactional actually is not. This can happen if you try to
          create a table using a transactional storage engine that is
          not supported by your <span><strong class="command">mysqld</strong></span> server (or
          that was disabled with a startup option). If
          <span><strong class="command">mysqld</strong></span> doesn't support a storage engine, it
          instead creates the table as a <code class="literal">MyISAM</code>
          table, which is non-transactional.
        </p><p>
          You can check the storage engine for a table by using either
          of these statements:
        </p><pre class="programlisting">SHOW TABLE STATUS LIKE '<em class="replaceable"><code>tbl_name</code></em>';
SHOW CREATE TABLE <em class="replaceable"><code>tbl_name</code></em>;
</pre><p>
          See <a href="sql-syntax.html#show-table-status" title="12.5.4.24. SHOW TABLE STATUS Syntax">Section 12.5.4.24, “<code class="literal">SHOW TABLE STATUS</code> Syntax”</a>, and
          <a href="sql-syntax.html#show-create-table" title="12.5.4.6. SHOW CREATE TABLE Syntax">Section 12.5.4.6, “<code class="literal">SHOW CREATE TABLE</code> Syntax”</a>.
        </p><p>
          You can check which storage engines your
          <span><strong class="command">mysqld</strong></span> server supports by using this
          statement:
        </p><pre class="programlisting">SHOW ENGINES;
</pre><p>
          You can also use the following statement, and check the value
          of the variable that is associated with the storage engine in
          which you are interested:
        </p><pre class="programlisting">SHOW VARIABLES LIKE 'have_%';
</pre><p>
          For example, to determine whether the
          <code class="literal">InnoDB</code> storage engine is available, check
          the value of the <code class="literal">have_innodb</code> variable.
        </p><p>
          See <a href="sql-syntax.html#show-engines" title="12.5.4.10. SHOW ENGINES Syntax">Section 12.5.4.10, “<code class="literal">SHOW ENGINES</code> Syntax”</a>, and
          <a href="sql-syntax.html#show-variables" title="12.5.4.27. SHOW VARIABLES Syntax">Section 12.5.4.27, “<code class="literal">SHOW VARIABLES</code> Syntax”</a>.
        </p><p class="mnmas"><b>MySQL Enterprise</b>
            Ensure that your data is adequately protected by subscribing
            to the MySQL Enterprise Monitor. For more information, see
            <a href="http://www.mysql.com/products/enterprise/advisors.html" target="_top">http://www.mysql.com/products/enterprise/advisors.html</a>.
          </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="deleting-from-related-tables"></a>B.1.5.6. Deleting Rows from Related Tables</h4></div></div></div><a class="indexterm" name="id3185983"></a><a class="indexterm" name="id3185995"></a><a class="indexterm" name="id3186008"></a><p>
          If the total length of the <code class="literal">DELETE</code> statement
          for <code class="literal">related_table</code> is more than 1MB (the
          default value of the <code class="literal">max_allowed_packet</code>
          system variable), you should split it into smaller parts and
          execute multiple <code class="literal">DELETE</code> statements. You
          probably get the fastest <code class="literal">DELETE</code> by
          specifying only 100 to 1,000 <code class="literal">related_column</code>
          values per statement if the <code class="literal">related_column</code>
          is indexed. If the <code class="literal">related_column</code> isn't
          indexed, the speed is independent of the number of arguments
          in the <code class="literal">IN</code> clause.
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="no-matching-rows"></a>B.1.5.7. Solving Problems with No Matching Rows</h4></div></div></div><a class="indexterm" name="id3186094"></a><a class="indexterm" name="id3186104"></a><p>
          If you have a complicated query that uses many tables but that
          doesn't return any rows, you should use the following
          procedure to find out what is wrong:
        </p><div class="orderedlist"><ol type="1"><li><p>
              Test the query with <code class="literal">EXPLAIN</code> to check
              whether you can find something that is obviously wrong.
              See <a href="optimization.html#explain" title="6.2.1. Optimizing Queries with EXPLAIN">Section 6.2.1, “Optimizing Queries with <code class="literal">EXPLAIN</code>”</a>.
            </p></li><li><p>
              Select only those columns that are used in the
              <code class="literal">WHERE</code> clause.
            </p></li><li><p>
              Remove one table at a time from the query until it returns
              some rows. If the tables are large, it's a good idea to
              use <code class="literal">LIMIT 10</code> with the query.
            </p></li><li><p>
              Issue a <code class="literal">SELECT</code> for the column that
              should have matched a row against the table that was last
              removed from the query.
            </p></li><li><p>
              If you are comparing <code class="literal">FLOAT</code> or
              <code class="literal">DOUBLE</code> columns with numbers that have
              decimals, you can't use equality (<code class="literal">=</code>)
              comparisons. This problem is common in most computer
              languages because not all floating-point values can be
              stored with exact precision. In some cases, changing the
              <code class="literal">FLOAT</code> to a <code class="literal">DOUBLE</code>
              fixes this. See <a href="error-handling.html#problems-with-float" title="B.1.5.8. Problems with Floating-Point Comparisons">Section B.1.5.8, “Problems with Floating-Point Comparisons”</a>.
            </p><p>
              Similar problems may be encountered when comparing
              <code class="literal">DECIMAL</code> values prior to MySQL 5.0.3.
            </p></li><li><p>
              If you still can't figure out what's wrong, create a
              minimal test that can be run with <code class="literal">mysql test &lt;
              query.sql</code> that shows your problems. You can
              create a test file by dumping the tables with
              <span><strong class="command">mysqldump --quick db_name
              <em class="replaceable"><code>tbl_name_1</code></em> ...
              <em class="replaceable"><code>tbl_name_n</code></em> &gt;
              query.sql</strong></span>. Open the file in an editor, remove
              some insert lines (if there are more than needed to
              demonstrate the problem), and add your
              <code class="literal">SELECT</code> statement at the end of the
              file.
            </p><p>
              Verify that the test file demonstrates the problem by
              executing these commands:
            </p><pre class="programlisting">shell&gt; <strong class="userinput"><code>mysqladmin create test2</code></strong>
shell&gt; <strong class="userinput"><code>mysql test2 &lt; query.sql</code></strong>
</pre><p>
              Attach the test file to a bug report, which you can file
              using the instructions in <a href="introduction.html#bug-reports" title="1.7. How to Report Bugs or Problems">Section 1.7, “How to Report Bugs or Problems”</a>.
            </p></li></ol></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="problems-with-float"></a>B.1.5.8. Problems with Floating-Point Comparisons</h4></div></div></div><p>
          Floating-point numbers sometimes cause confusion because they
          are approximate. That is, they are not stored as exact values
          inside computer architecture. What you can see on the screen
          usually is not the exact value of the number. The
          <code class="literal">FLOAT</code> and <code class="literal">DOUBLE</code> data
          types are such, and <code class="literal">DECIMAL</code> operations
          before MySQL 5.0.3 are approximate as well.
        </p><p>
          Prior to MySQL 5.0.3, <code class="literal">DECIMAL</code> columns store
          values with exact precision because they are represented as
          strings, but calculations on <code class="literal">DECIMAL</code> values
          are done using floating-point operations. As of 5.0.6, MySQL
          performs <code class="literal">DECIMAL</code> operations with a
          precision of 65 decimal digits (64 digits from 5.0.3 to
          5.0.5), which should solve most common inaccuracy problems
          when it comes to <code class="literal">DECIMAL</code> columns. (If your
          server is from MySQL 5.0.3 or higher, but you have
          <code class="literal">DECIMAL</code> columns in tables that were created
          before 5.0.3, the old behavior still applies to those columns.
          To convert the tables to the newer <code class="literal">DECIMAL</code>
          format, dump them with <span><strong class="command">mysqldump</strong></span> and reload
          them.)
        </p><p>
          The following example (for versions of MySQL older than 5.0.3)
          demonstrates the problem. It shows that even for older
          <code class="literal">DECIMAL</code> columns, calculations that are done
          using floating-point operations are subject to floating-point
          error. (Were you to replace the <code class="literal">DECIMAL</code>
          columns with <code class="literal">FLOAT</code>, similar problems would
          occur for all versions of MySQL.)
        </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>CREATE TABLE t1 (i INT, d1 DECIMAL(9,2), d2 DECIMAL(9,2));</code></strong>
mysql&gt; <strong class="userinput"><code>INSERT INTO t1 VALUES (1, 101.40, 21.40), (1, -80.00, 0.00),</code></strong>
    -&gt; <strong class="userinput"><code>(2, 0.00, 0.00), (2, -13.20, 0.00), (2, 59.60, 46.40),</code></strong>
    -&gt; <strong class="userinput"><code>(2, 30.40, 30.40), (3, 37.00, 7.40), (3, -29.60, 0.00),</code></strong>
    -&gt; <strong class="userinput"><code>(4, 60.00, 15.40), (4, -10.60, 0.00), (4, -34.00, 0.00),</code></strong>
    -&gt; <strong class="userinput"><code>(5, 33.00, 0.00), (5, -25.80, 0.00), (5, 0.00, 7.20),</code></strong>
    -&gt; <strong class="userinput"><code>(6, 0.00, 0.00), (6, -51.40, 0.00);</code></strong>

mysql&gt; <strong class="userinput"><code>SELECT i, SUM(d1) AS a, SUM(d2) AS b</code></strong>
    -&gt; <strong class="userinput"><code>FROM t1 GROUP BY i HAVING a &lt;&gt; b;</code></strong>
+------+--------+-------+
| i    | a      | b     |
+------+--------+-------+
|    1 |  21.40 | 21.40 |
|    2 |  76.80 | 76.80 |
|    3 |   7.40 |  7.40 |
|    4 |  15.40 | 15.40 |
|    5 |   7.20 |  7.20 |
|    6 | -51.40 |  0.00 |
+------+--------+-------+
</pre><p>
          The result is correct. Although the first five records look
          like they should not satisfy the comparison (the values of
          <code class="literal">a</code> and <code class="literal">b</code> do not appear to
          be different), they may do so because the difference between
          the numbers shows up around the tenth decimal or so, depending
          on factors such as computer architecture or the compiler
          version or optimization level. For example, different CPUs may
          evaluate floating-point numbers differently.
        </p><p>
          As of MySQL 5.0.3, you will get only the last row in the above
          result.
        </p><p>
          The problem cannot be solved by using
          <a href="functions.html#function_round"><code class="literal">ROUND()</code></a> or similar functions,
          because the result is still a floating-point number:
        </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>SELECT i, ROUND(SUM(d1), 2) AS a, ROUND(SUM(d2), 2) AS b</code></strong>
    -&gt; <strong class="userinput"><code>FROM t1 GROUP BY i HAVING a &lt;&gt; b;</code></strong>
+------+--------+-------+
| i    | a      | b     |
+------+--------+-------+
|    1 |  21.40 | 21.40 |
|    2 |  76.80 | 76.80 |
|    3 |   7.40 |  7.40 |
|    4 |  15.40 | 15.40 |
|    5 |   7.20 |  7.20 |
|    6 | -51.40 |  0.00 |
+------+--------+-------+
</pre><p>
          This is what the numbers in column <code class="literal">a</code> look
          like when displayed with more decimal places:
        </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>SELECT i, ROUND(SUM(d1), 2)*1.0000000000000000 AS a,</code></strong>
    -&gt; <strong class="userinput"><code>ROUND(SUM(d2), 2) AS b FROM t1 GROUP BY i HAVING a &lt;&gt; b;</code></strong>
+------+----------------------+-------+
| i    | a                    | b     |
+------+----------------------+-------+
|    1 |  21.3999999999999986 | 21.40 |
|    2 |  76.7999999999999972 | 76.80 |
|    3 |   7.4000000000000004 |  7.40 |
|    4 |  15.4000000000000004 | 15.40 |
|    5 |   7.2000000000000002 |  7.20 |
|    6 | -51.3999999999999986 |  0.00 |
+------+----------------------+-------+
</pre><p>
          Depending on your computer architecture, you may or may not
          see similar results. For example, on some machines you may get
          the “<span class="quote">correct</span>” results by multiplying both
          arguments by 1, as the following example shows.
        </p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>
            Never use this method in your applications. It is not an
            example of a trustworthy method!
          </p></div><pre class="programlisting">mysql&gt; <strong class="userinput"><code>SELECT i, ROUND(SUM(d1), 2)*1 AS a, ROUND(SUM(d2), 2)*1 AS b</code></strong>
    -&gt; <strong class="userinput"><code>FROM t1 GROUP BY i HAVING a &lt;&gt; b;</code></strong>
+------+--------+------+
| i    | a      | b    |
+------+--------+------+
|    6 | -51.40 | 0.00 |
+------+--------+------+
</pre><p>
          The reason that the preceding example seems to work is that on
          the particular machine where the test was done, CPU
          floating-point arithmetic happens to round the numbers to the
          same value. However, there is no rule that any CPU should do
          so, so this method cannot be trusted.
        </p><p>
          The correct way to do floating-point number comparison is to
          first decide on an acceptable tolerance for differences
          between the numbers and then do the comparison against the
          tolerance value. For example, if we agree that floating-point
          numbers should be regarded the same if they are same within a
          precision of one in ten thousand (0.0001), the comparison
          should be written to find differences larger than the
          tolerance value:
        </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>SELECT i, SUM(d1) AS a, SUM(d2) AS b FROM t1</code></strong>
    -&gt; <strong class="userinput"><code>GROUP BY i HAVING ABS(a - b) &gt; 0.0001;</code></strong>
+------+--------+------+
| i    | a      | b    |
+------+--------+------+
|    6 | -51.40 | 0.00 |
+------+--------+------+
1 row in set (0.00 sec)
</pre><p>
          Conversely, to get rows where the numbers are the same, the
          test should find differences within the tolerance value:
        </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>SELECT i, SUM(d1) AS a, SUM(d2) AS b FROM t1</code></strong>
    -&gt; <strong class="userinput"><code>GROUP BY i HAVING ABS(a - b) &lt;= 0.0001;</code></strong>
+------+-------+-------+
| i    | a     | b     |
+------+-------+-------+
|    1 | 21.40 | 21.40 |
|    2 | 76.80 | 76.80 |
|    3 |  7.40 |  7.40 |
|    4 | 15.40 | 15.40 |
|    5 |  7.20 |  7.20 |
+------+-------+-------+
</pre></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="optimizer-issues"></a>B.1.6. Optimizer-Related Issues</h3></div></div></div><p>
        MySQL uses a cost-based optimizer to determine the best way to
        resolve a query. In many cases, MySQL can calculate the best
        possible query plan, but sometimes MySQL doesn't have enough
        information about the data at hand and has to make
        “<span class="quote">educated</span>” guesses about the data.
      </p><p>
        For the cases when MySQL does not do the "right" thing, tools
        that you have available to help MySQL are:
      </p><div class="itemizedlist"><ul type="disc"><li><p>
            Use the <code class="literal">EXPLAIN</code> statement to get
            information about how MySQL processes a query. To use it,
            just add the keyword <code class="literal">EXPLAIN</code> to the front
            of your <code class="literal">SELECT</code> statement:
          </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>EXPLAIN SELECT * FROM t1, t2 WHERE t1.i = t2.i;</code></strong>
</pre><p>
            <code class="literal">EXPLAIN</code> is discussed in more detail in
            <a href="optimization.html#explain" title="6.2.1. Optimizing Queries with EXPLAIN">Section 6.2.1, “Optimizing Queries with <code class="literal">EXPLAIN</code>”</a>.
          </p></li><li><p>
            Use <code class="literal">ANALYZE TABLE
            <em class="replaceable"><code>tbl_name</code></em></code> to update the
            key distributions for the scanned table. See
            <a href="sql-syntax.html#analyze-table" title="12.5.2.1. ANALYZE TABLE Syntax">Section 12.5.2.1, “<code class="literal">ANALYZE TABLE</code> Syntax”</a>.
          </p></li><li><p>
            <a class="indexterm" name="id3186851"></a>

            Use <code class="literal">FORCE INDEX</code> for the scanned table to
            tell MySQL that table scans are very expensive compared to
            using the given index:
          </p><pre class="programlisting">SELECT * FROM t1, t2 FORCE INDEX (index_for_column)
WHERE t1.col_name=t2.col_name;
</pre><p>
            <code class="literal">USE INDEX</code> and <code class="literal">IGNORE
            INDEX</code> may also be useful. See
            <a href="sql-syntax.html#index-hints" title="12.2.7.2. Index Hint Syntax">Section 12.2.7.2, “Index Hint Syntax”</a>.
          </p></li><li><p>
            Global and table-level <code class="literal">STRAIGHT_JOIN</code>. See
            <a href="sql-syntax.html#select" title="12.2.7. SELECT Syntax">Section 12.2.7, “<code class="literal">SELECT</code> Syntax”</a>.
          </p></li><li><p>
            You can tune global or thread-specific system variables. For
            example, Start <span><strong class="command">mysqld</strong></span> with the
            <code class="option">--max-seeks-for-key=1000</code> option or use
            <code class="literal">SET max_seeks_for_key=1000</code> to tell the
            optimizer to assume that no key scan causes more than 1,000
            key seeks. See <a href="server-administration.html#server-system-variables" title="5.2.3. System Variables">Section 5.2.3, “System Variables”</a>.
          </p></li></ul></div><p class="mnmas"><b>MySQL Enterprise</b>
          For expert advice on configuring MySQL servers for optimal
          performance, subscribe to the MySQL Enterprise Monitor. For
          more information, see
          <a href="http://www.mysql.com/products/enterprise/advisors.html" target="_top">http://www.mysql.com/products/enterprise/advisors.html</a>.
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="table-definition-issues"></a>B.1.7. Table Definition-Related Issues</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="error-handling.html#alter-table-problems">B.1.7.1. Problems with <code class="literal">ALTER TABLE</code></a></span></dt><dt><span class="section"><a href="error-handling.html#change-column-order">B.1.7.2. How to Change the Order of Columns in a Table</a></span></dt><dt><span class="section"><a href="error-handling.html#temporary-table-problems">B.1.7.3. <code class="literal">TEMPORARY TABLE</code> Problems</a></span></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="alter-table-problems"></a>B.1.7.1. Problems with <code class="literal">ALTER TABLE</code></h4></div></div></div><a class="indexterm" name="id3186993"></a><a class="indexterm" name="id3187002"></a><a class="indexterm" name="id3187014"></a><p>
          <code class="literal">ALTER TABLE</code> changes a table to the current
          character set. If you get a duplicate-key error during
          <code class="literal">ALTER TABLE</code>, the cause is either that the
          new character sets maps two keys to the same value or that the
          table is corrupted. In the latter case, you should run
          <code class="literal">REPAIR TABLE</code> on the table.
        </p><p>
          If <code class="literal">ALTER TABLE</code> dies with the following
          error, the problem may be that MySQL crashed during an earlier
          <code class="literal">ALTER TABLE</code> operation and there is an old
          table named
          <code class="filename">A-<em class="replaceable"><code>xxx</code></em></code> or
          <code class="filename">B-<em class="replaceable"><code>xxx</code></em></code> lying
          around:
        </p><pre class="programlisting">Error on rename of './database/name.frm'
to './database/B-<em class="replaceable"><code>xxx</code></em>.frm' (Errcode: 17)
</pre><p>
          In this case, go to the MySQL data directory and delete all
          files that have names starting with <code class="literal">A-</code> or
          <code class="literal">B-</code>. (You may want to move them elsewhere
          instead of deleting them.)
        </p><p>
          <code class="literal">ALTER TABLE</code> works in the following way:
        </p><div class="itemizedlist"><ul type="disc"><li><p>
              Create a new table named
              <code class="filename">A-<em class="replaceable"><code>xxx</code></em></code> with
              the requested structural changes.
            </p></li><li><p>
              Copy all rows from the original table to
              <code class="filename">A-<em class="replaceable"><code>xxx</code></em></code>.
            </p></li><li><p>
              Rename the original table to
              <code class="filename">B-<em class="replaceable"><code>xxx</code></em></code>.
            </p></li><li><p>
              Rename
              <code class="filename">A-<em class="replaceable"><code>xxx</code></em></code> to
              your original table name.
            </p></li><li><p>
              Delete
              <code class="filename">B-<em class="replaceable"><code>xxx</code></em></code>.
            </p></li></ul></div><p>
          If something goes wrong with the renaming operation, MySQL
          tries to undo the changes. If something goes seriously wrong
          (although this shouldn't happen), MySQL may leave the old
          table as
          <code class="filename">B-<em class="replaceable"><code>xxx</code></em></code>. A
          simple rename of the table files at the system level should
          get your data back.
        </p><p>
          If you use <code class="literal">ALTER TABLE</code> on a transactional
          table or if you are using Windows or OS/2, <code class="literal">ALTER
          TABLE</code> unlocks the table if you had done a
          <code class="literal">LOCK TABLE</code> on it. This is done because
          <code class="literal">InnoDB</code> and these operating systems cannot
          drop a table that is in use.
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="change-column-order"></a>B.1.7.2. How to Change the Order of Columns in a Table</h4></div></div></div><a class="indexterm" name="id3187266"></a><a class="indexterm" name="id3187278"></a><a class="indexterm" name="id3187291"></a><a class="indexterm" name="id3187303"></a><p>
          First, consider whether you really need to change the column
          order in a table. The whole point of SQL is to abstract the
          application from the data storage format. You should always
          specify the order in which you wish to retrieve your data. The
          first of the following statements returns columns in the order
          <em class="replaceable"><code>col_name1</code></em>,
          <em class="replaceable"><code>col_name2</code></em>,
          <em class="replaceable"><code>col_name3</code></em>, whereas the second
          returns them in the order
          <em class="replaceable"><code>col_name1</code></em>,
          <em class="replaceable"><code>col_name3</code></em>,
          <em class="replaceable"><code>col_name2</code></em>:
        </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>SELECT <em class="replaceable"><code>col_name1</code></em>, <em class="replaceable"><code>col_name2</code></em>, <em class="replaceable"><code>col_name3</code></em> FROM <em class="replaceable"><code>tbl_name</code></em>;</code></strong>
mysql&gt; <strong class="userinput"><code>SELECT <em class="replaceable"><code>col_name1</code></em>, <em class="replaceable"><code>col_name3</code></em>, <em class="replaceable"><code>col_name2</code></em> FROM <em class="replaceable"><code>tbl_name</code></em>;</code></strong>
</pre><p>
          If you decide to change the order of table columns anyway, you
          can do so as follows:
        </p><div class="orderedlist"><ol type="1"><li><p>
              Create a new table with the columns in the new order.
            </p></li><li><p>
              Execute this statement:
            </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>INSERT INTO new_table</code></strong>
    -&gt; <strong class="userinput"><code>SELECT columns-in-new-order FROM old_table;</code></strong>
</pre></li><li><p>
              Drop or rename <code class="literal">old_table</code>.
            </p></li><li><p>
              Rename the new table to the original name:
            </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>ALTER TABLE new_table RENAME old_table;</code></strong>
</pre></li></ol></div><p>
          <code class="literal">SELECT *</code> is quite suitable for testing
          queries. However, in an application, you should
          <span class="emphasis"><em>never</em></span> rely on using <code class="literal">SELECT
          *</code> and retrieving the columns based on their
          position. The order and position in which columns are returned
          does not remain the same if you add, move, or delete columns.
          A simple change to your table structure could cause your
          application to fail.
        </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="temporary-table-problems"></a>B.1.7.3. <code class="literal">TEMPORARY TABLE</code> Problems</h4></div></div></div><a class="indexterm" name="id3187515"></a><p>
          The following list indicates limitations on the use of
          <code class="literal">TEMPORARY</code> tables:
        </p><div class="itemizedlist"><ul type="disc"><li><p>
              A <code class="literal">TEMPORARY</code> table can only be of type
              <code class="literal">MEMORY</code>, <code class="literal">MyISAM</code>,
              <code class="literal">MERGE</code>, or <code class="literal">InnoDB</code>.
            </p><p>
              Temporary tables are not supported for MySQL Cluster.
            </p></li><li><p>
              You cannot refer to a <code class="literal">TEMPORARY</code> table
              more than once in the same query. For example, the
              following does not work:
            </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>SELECT * FROM temp_table, temp_table AS t2;</code></strong>
ERROR 1137: Can't reopen table: 'temp_table'
</pre></li><li><p>
              The <code class="literal">SHOW TABLES</code> statement does not list
              <code class="literal">TEMPORARY</code> tables.
            </p></li><li><p>
              You cannot use <code class="literal">RENAME</code> to rename a
              <code class="literal">TEMPORARY</code> table. However, you can use
              <code class="literal">ALTER TABLE</code> instead:
            </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>ALTER TABLE orig_name RENAME new_name;</code></strong>
</pre></li><li><p>
              There are known issues in using temporary tables with
              replication. See <a href="replication.html#replication-features" title="15.3.1. Replication Features and Issues">Section 15.3.1, “Replication Features and Issues”</a>,
              for more information.
            </p></li></ul></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="bugs"></a>B.1.8. Known Issues in MySQL</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="error-handling.html#open-bugs">B.1.8.1. Open Issues in MySQL</a></span></dt></dl></div><a class="indexterm" name="id3187694"></a><a class="indexterm" name="id3187706"></a><a class="indexterm" name="id3187719"></a><a class="indexterm" name="id3187731"></a><p>
        This section is a list of the known issues in recent versions of
        MySQL.
      </p><p>
        For information about platform-specific issues, see the
        installation and porting instructions in
        <a href="installing.html#operating-system-specific-notes" title="2.4.19. Operating System-Specific Notes">Section 2.4.19, “Operating System-Specific Notes”</a>, and
        <a href="http://forge.mysql.com/wiki/MySQL_Internals_Porting" target="_top">MySQL
        Internals: Porting</a>.
      </p><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="open-bugs"></a>B.1.8.1. Open Issues in MySQL</h4></div></div></div><p>
          The following problems are known and fixing them is a high
          priority:
        </p><div class="itemizedlist"><ul type="disc"><li><p>
              Subquery optimization for <code class="literal">IN</code> is not as
              effective as for <code class="literal">=</code>.
            </p></li><li><p>
              Even if you use
              <code class="literal">lower_case_table_names=2</code> (which enables
              MySQL to remember the case used for databases and table
              names), MySQL does not remember the case used for database
              names for the function
              <a href="functions.html#function_database"><code class="literal">DATABASE()</code></a> or within the
              various logs (on case-insensitive systems).
            </p></li><li><p>
              Dropping a <code class="literal">FOREIGN KEY</code> constraint
              doesn't work in replication because the constraint may
              have another name on the slave.
            </p></li><li><p>
              <code class="literal">REPLACE</code> (and <code class="literal">LOAD
              DATA</code> with the <code class="literal">REPLACE</code> option)
              does not trigger <code class="literal">ON DELETE CASCADE</code>.
            </p></li><li><p>
              <code class="literal">DISTINCT</code> with <code class="literal">ORDER
              BY</code> doesn't work inside
              <a href="functions.html#function_group-concat"><code class="literal">GROUP_CONCAT()</code></a> if you
              don't use all and only those columns that are in the
              <code class="literal">DISTINCT</code> list.
            </p></li><li><p>
              If one user has a long-running transaction and another
              user drops a table that is updated in the transaction,
              there is small chance that the binary log may contain the
              <code class="literal">DROP TABLE</code> command before the table is
              used in the transaction itself. We plan to fix this by
              having the <code class="literal">DROP TABLE</code> command wait
              until the table is not being used in any transaction.
            </p></li><li><p>
              When inserting a big integer value (between
              2<sup>63</sup> and
              2<sup>64</sup>–1) into a decimal or
              string column, it is inserted as a negative value because
              the number is evaluated in a signed integer context.
            </p></li><li><p>
              <code class="literal">FLUSH TABLES WITH READ LOCK</code> does not
              block <code class="literal">COMMIT</code> if the server is running
              without binary logging, which may cause a problem (of
              consistency between tables) when doing a full backup.
            </p></li><li><p>
              <code class="literal">ANALYZE TABLE</code> on a
              <code class="literal">BDB</code> table may in some cases make the
              table unusable until you restart
              <span><strong class="command">mysqld</strong></span>. If this happens, look for
              errors of the following form in the MySQL error file:
            </p><pre class="programlisting">001207 22:07:56  bdb:  log_flush: LSN past current end-of-log
</pre></li><li><p>
              Don't execute <code class="literal">ALTER TABLE</code> on a
              <code class="literal">BDB</code> table on which you are running
              multiple-statement transactions until all those
              transactions complete. (The transaction might be ignored.)
            </p></li><li><p>
              <code class="literal">ANALYZE TABLE</code>, <code class="literal">OPTIMIZE
              TABLE</code>, and <code class="literal">REPAIR TABLE</code> may
              cause problems on tables for which you are using
              <code class="literal">INSERT DELAYED</code>.
            </p></li><li><p>
              Performing <code class="literal">LOCK TABLE ...</code> and
              <code class="literal">FLUSH TABLES ...</code> doesn't guarantee that
              there isn't a half-finished transaction in progress on the
              table.
            </p></li><li><p>
              <code class="literal">BDB</code> tables are relatively slow to open.
              If you have many <code class="literal">BDB</code> tables in a
              database, it takes a long time to use the
              <span><strong class="command">mysql</strong></span> client on the database if you are
              not using the <code class="literal">-A</code> option or if you are
              using <code class="literal">rehash</code>. This is especially
              noticeable when you have a large table cache.
            </p></li><li><p>
              Replication uses query-level logging: The master writes
              the executed queries to the binary log. This is a very
              fast, compact, and efficient logging method that works
              perfectly in most cases.
            </p><p>
              It is possible for the data on the master and slave to
              become different if a query is designed in such a way that
              the data modification is non-deterministic (generally not
              a recommended practice, even outside of replication).
            </p><p>
              For example:
            </p><div class="itemizedlist"><ul type="circle"><li><p>
                  <code class="literal">CREATE ... SELECT</code> or
                  <code class="literal">INSERT ... SELECT</code> statements that
                  insert zero or <code class="literal">NULL</code> values into an
                  <code class="literal">AUTO_INCREMENT</code> column.
                </p></li><li><p>
                  <code class="literal">DELETE</code> if you are deleting rows
                  from a table that has foreign keys with <code class="literal">ON
                  DELETE CASCADE</code> properties.
                </p></li><li><p>
                  <code class="literal">REPLACE ... SELECT</code>, <code class="literal">INSERT
                  IGNORE ... SELECT</code> if you have duplicate key
                  values in the inserted data.
                </p></li></ul></div><p>
              <span class="bold"><strong>If and only if the preceding queries
              have no <code class="literal">ORDER BY</code> clause guaranteeing a
              deterministic order</strong></span>.
            </p><p>
              For example, for <code class="literal">INSERT ... SELECT</code> with
              no <code class="literal">ORDER BY</code>, the
              <code class="literal">SELECT</code> may return rows in a different
              order (which results in a row having different ranks,
              hence getting a different number in the
              <code class="literal">AUTO_INCREMENT</code> column), depending on
              the choices made by the optimizers on the master and
              slave.
            </p><p>
              A query is optimized differently on the master and slave
              only if:
            </p><div class="itemizedlist"><ul type="circle"><li><p>
                  The table is stored using a different storage engine
                  on the master than on the slave. (It is possible to
                  use different storage engines on the master and slave.
                  For example, you can use <code class="literal">InnoDB</code> on
                  the master, but <code class="literal">MyISAM</code> on the slave
                  if the slave has less available disk space.)
                </p></li><li><p>
                  MySQL buffer sizes
                  (<code class="literal">key_buffer_size</code>, and so on) are
                  different on the master and slave.
                </p></li><li><p>
                  The master and slave run different MySQL versions, and
                  the optimizer code differs between these versions.
                </p></li></ul></div><p>
              This problem may also affect database restoration using
              <span><strong class="command">mysqlbinlog|mysql</strong></span>.
            </p><p>
              The easiest way to avoid this problem is to add an
              <code class="literal">ORDER BY</code> clause to the aforementioned
              non-deterministic queries to ensure that the rows are
              always stored or modified in the same order.
            </p><p>
              In future MySQL versions, we will automatically add an
              <code class="literal">ORDER BY</code> clause when needed.
            </p></li></ul></div><p>
          The following issues are known and will be fixed in due time:
        </p><div class="itemizedlist"><ul type="disc"><li><p>
              Log filenames are based on the server hostname (if you
              don't specify a filename with the startup option). You
              have to use options such as
              <code class="option">--log-bin=<em class="replaceable"><code>old_host_name</code></em>-bin</code>
              if you change your hostname to something else. Another
              option is to rename the old files to reflect your hostname
              change (if these are binary logs, you need to edit the
              binary log index file and fix the binlog names there as
              well). See <a href="server-administration.html#server-options" title="5.2.2. Command Options">Section 5.2.2, “Command Options”</a>.
            </p></li><li><p>
              <span><strong class="command">mysqlbinlog</strong></span> does not delete temporary
              files left after a <code class="literal">LOAD DATA INFILE</code>
              command. See <a href="client-utility-programs.html#mysqlbinlog" title="7.10. mysqlbinlog — Utility for Processing Binary Log Files">Section 7.10, “<span><strong class="command">mysqlbinlog</strong></span> — Utility for Processing Binary Log Files”</a>.
            </p></li><li><p>
              <code class="literal">RENAME</code> doesn't work with
              <code class="literal">TEMPORARY</code> tables or tables used in a
              <code class="literal">MERGE</code> table.
            </p></li><li><p>
              Due to the way table format (<code class="filename">.frm</code>)
              files are stored, you cannot use character 255
              (<code class="literal">CHAR(255)</code>) in table names, column
              names, or enumerations. This is scheduled to be fixed in
              version 5.1 when we implement new table definition format
              files.
            </p></li><li><p>
              When using <code class="literal">SET CHARACTER SET</code>, you can't
              use translated characters in database, table, and column
              names.
            </p></li><li><p>
              You can't use “<span class="quote"><code class="literal">_</code></span>” or
              “<span class="quote"><code class="literal">%</code></span>” with
              <code class="literal">ESCAPE</code> in <code class="literal">LIKE ...
              ESCAPE</code>.
            </p></li><li><p>
              You cannot build the server in another directory when
              using MIT-pthreads. Because this requires changes to
              MIT-pthreads, we are not likely to fix this. See
              <a href="installing.html#mit-pthreads" title="2.4.15.5. MIT-pthreads Notes">Section 2.4.15.5, “MIT-pthreads Notes”</a>.
            </p></li><li><p>
              <code class="literal">BLOB</code> and <code class="literal">TEXT</code> values
              can't reliably be used in <code class="literal">GROUP BY</code>,
              <code class="literal">ORDER BY</code> or
              <code class="literal">DISTINCT</code>. Only the first
              <code class="literal">max_sort_length</code> bytes are used when
              comparing <code class="literal">BLOB</code> values in these cases.
              The default value of <code class="literal">max_sort_length</code> is
              1024 and can be changed at server startup time or at
              runtime.
            </p></li><li><p>
              Numeric calculations are done with
              <code class="literal">BIGINT</code> or <code class="literal">DOUBLE</code>
              (both are normally 64 bits long). Which precision you get
              depends on the function. The general rule is that bit
              functions are performed with <code class="literal">BIGINT</code>
              precision, <code class="literal">IF</code> and
              <a href="functions.html#function_elt"><code class="literal">ELT()</code></a> with
              <code class="literal">BIGINT</code> or <code class="literal">DOUBLE</code>
              precision, and the rest with <code class="literal">DOUBLE</code>
              precision. You should try to avoid using unsigned long
              long values if they resolve to be larger than 63 bits
              (9223372036854775807) for anything other than bit fields.
            </p></li><li><p>
              You can have up to 255 <code class="literal">ENUM</code> and
              <code class="literal">SET</code> columns in one table.
            </p></li><li><p>
              In <a href="functions.html#function_min"><code class="literal">MIN()</code></a>,
              <a href="functions.html#function_max"><code class="literal">MAX()</code></a>, and other aggregate
              functions, MySQL currently compares
              <code class="literal">ENUM</code> and <code class="literal">SET</code> columns
              by their string value rather than by the string's relative
              position in the set.
            </p></li><li><p>
              <span><strong class="command">mysqld_safe</strong></span> redirects all messages from
              <span><strong class="command">mysqld</strong></span> to the <span><strong class="command">mysqld</strong></span>
              log. One problem with this is that if you execute
              <span><strong class="command">mysqladmin refresh</strong></span> to close and reopen
              the log, <code class="literal">stdout</code> and
              <code class="literal">stderr</code> are still redirected to the old
              log. If you use <code class="option">--log</code> extensively, you
              should edit <span><strong class="command">mysqld_safe</strong></span> to log to
              <code class="filename"><em class="replaceable"><code>host_name</code></em>.err</code>
              instead of
              <code class="filename"><em class="replaceable"><code>host_name</code></em>.log</code>
              so that you can easily reclaim the space for the old log
              by deleting it and executing <span><strong class="command">mysqladmin
              refresh</strong></span>.
            </p></li><li><p>
              In an <code class="literal">UPDATE</code> statement, columns are
              updated from left to right. If you refer to an updated
              column, you get the updated value instead of the original
              value. For example, the following statement increments
              <code class="literal">KEY</code> by <code class="literal">2</code>,
              <span class="bold"><strong>not</strong></span> <code class="literal">1</code>:
            </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>UPDATE <em class="replaceable"><code>tbl_name</code></em> SET KEY=KEY+1,KEY=KEY+1;</code></strong>
</pre></li><li><p>
              You can refer to multiple temporary tables in the same
              query, but you cannot refer to any given temporary table
              more than once. For example, the following doesn't work:
            </p><pre class="programlisting">mysql&gt; <strong class="userinput"><code>SELECT * FROM temp_table, temp_table AS t2;</code></strong>
ERROR 1137: Can't reopen table: 'temp_table'
</pre></li><li><p>
              The optimizer may handle <code class="literal">DISTINCT</code>
              differently when you are using “<span class="quote">hidden</span>”
              columns in a join than when you are not. In a join, hidden
              columns are counted as part of the result (even if they
              are not shown), whereas in normal queries, hidden columns
              don't participate in the <code class="literal">DISTINCT</code>
              comparison. We will probably change this in the future to
              never compare the hidden columns when executing
              <code class="literal">DISTINCT</code>.
            </p><p>
              An example of this is:
            </p><pre class="programlisting">SELECT DISTINCT mp3id FROM band_downloads
       WHERE userid = 9 ORDER BY id DESC;
</pre><p>
              and
            </p><pre class="programlisting">SELECT DISTINCT band_downloads.mp3id
       FROM band_downloads,band_mp3
       WHERE band_downloads.userid = 9
       AND band_mp3.id = band_downloads.mp3id
       ORDER BY band_downloads.id DESC;
</pre><p>
              In the second case, using MySQL Server 3.23.x, you may get
              two identical rows in the result set (because the values
              in the hidden <code class="literal">id</code> column may differ).
            </p><p>
              Note that this happens only for queries where that do not
              have the <code class="literal">ORDER BY</code> columns in the
              result.
            </p></li><li><p>
              If you execute a <code class="literal">PROCEDURE</code> on a query
              that returns an empty set, in some cases the
              <code class="literal">PROCEDURE</code> does not transform the
              columns.
            </p></li><li><p>
              Creation of a table of type <code class="literal">MERGE</code>
              doesn't check whether the underlying tables are compatible
              types.
            </p></li><li><p>
              If you use <code class="literal">ALTER TABLE</code> to add a
              <code class="literal">UNIQUE</code> index to a table used in a
              <code class="literal">MERGE</code> table and then add a normal index
              on the <code class="literal">MERGE</code> table, the key order is
              different for the tables if there was an old,
              non-<code class="literal">UNIQUE</code> key in the table. This is
              because <code class="literal">ALTER TABLE</code> puts
              <code class="literal">UNIQUE</code> indexes before normal indexes to
              be able to detect duplicate keys as early as possible.
            </p></li></ul></div></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="error-messages-server"></a>B.2. Server Error Codes and Messages</h2></div></div></div><p>
      MySQL programs have access to several types of error information
      when the server returns an error. For example, the
      <span><strong class="command">mysql</strong></span> client program displays errors using the
      following format:
    </p><pre class="programlisting">shell&gt; <strong class="userinput"><code>SELECT * FROM no_such_table;</code></strong>
ERROR 1146 (42S02): Table 'test.no_such_table' doesn't exist
</pre><p>
      The message displayed contains three types of information:
    </p><div class="itemizedlist"><ul type="disc"><li><p>
          A numeric error value (<code class="literal">1146</code>). This number
          is MySQL-specific and is not portable to other database
          systems.
        </p></li><li><p>
          A five-character SQLSTATE value (<code class="literal">'42S02'</code>).
          The values are specified by ANSI SQL and ODBC and are more
          standardized. Not all MySQL error numbers are mapped to
          SQLSTATE error codes. The value <code class="literal">'HY000'</code>
          (general error) is used for unmapped errors.
        </p></li><li><p>
          A string that provides a textual description of the error.
        </p></li></ul></div><p>
      Server error information comes from the following source files.
      For details about the way that error information is defined, see
      the MySQL Internals manual, available at
      <a href="http://dev.mysql.com/doc/" target="_top">http://dev.mysql.com/doc/</a>.
    </p><div class="itemizedlist"><ul type="disc"><li><p>
          Error message information is listed in the
          <code class="filename">share/errmsg.txt</code> file.
          <code class="literal">%d</code> and <code class="literal">%s</code> represent
          numbers and strings, respectively, that are substituted into
          the Message values when they are displayed.
        </p></li><li><p>
          The Error values listed in
          <code class="filename">share/errmsg.txt</code> are used to generate the
          definitions in the <code class="filename">include/mysqld_error.h</code>
          and <code class="filename">include/mysqld_ername.h</code> MySQL source
          files.
        </p></li><li><p>
          The SQLSTATE values listed in
          <code class="filename">share/errmsg.txt</code> are used to generate the
          definitions in the <code class="filename">include/sql_state.h</code>
          MySQL source file.
        </p></li></ul></div><p class="mnmas-kb"><b>MySQL Enterprise</b>
        MySQL Enterprise subscribers will find numerous articles about
        server error messages at,
        <a href="https://kb.mysql.com/search.php?cat=search&amp;pagerRow=0&amp;category=663" target="_top">
        Error Messages</a>. For information about subscribing to
        MySQL Enterprise see
        <a href="http://www.mysql.com/products/enterprise/advisors.html" target="_top">http://www.mysql.com/products/enterprise/advisors.html</a>.
      </p><p>
      Because updates are frequent, it is possible that those files will
      contain additional error information not listed here.
    </p><div class="itemizedlist"><ul type="disc"><li><p>
      Error: <code class="literal">1000</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_HASHCHK</code>)
    </p><p>
      Message: hashchk
    </p></li><li><p>
      Error: <code class="literal">1001</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_NISAMCHK</code>)
    </p><p>
      Message: isamchk
    </p></li><li><p>
      Error: <code class="literal">1002</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_NO</code>)
    </p><p>
      Message: NO
    </p></li><li><p>
      Error: <code class="literal">1003</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_YES</code>)
    </p><p>
      Message: YES
    </p></li><li><p>
      Error: <code class="literal">1004</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANT_CREATE_FILE</code>)
    </p><p>
      Message: Can't create file '%s' (errno: %d)
    </p></li><li><p>
      Error: <code class="literal">1005</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANT_CREATE_TABLE</code>)
    </p><p>
      Message: Can't create table '%s' (errno: %d)
    </p></li><li><p>
      Error: <code class="literal">1006</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANT_CREATE_DB</code>)
    </p><p>
      Message: Can't create database '%s' (errno: %d)
    </p></li><li><p>
      Error: <code class="literal">1007</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_DB_CREATE_EXISTS</code>)
    </p><p>
      Message: Can't create database '%s'; database exists
    </p></li><li><p>
      Error: <code class="literal">1008</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_DB_DROP_EXISTS</code>)
    </p><p>
      Message: Can't drop database '%s'; database doesn't exist
    </p></li><li><p>
      Error: <code class="literal">1009</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_DB_DROP_DELETE</code>)
    </p><p>
      Message: Error dropping database (can't delete '%s', errno: %d)
    </p></li><li><p>
      Error: <code class="literal">1010</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_DB_DROP_RMDIR</code>)
    </p><p>
      Message: Error dropping database (can't rmdir '%s', errno: %d)
    </p></li><li><p>
      Error: <code class="literal">1011</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANT_DELETE_FILE</code>)
    </p><p>
      Message: Error on delete of '%s' (errno: %d)
    </p></li><li><p>
      Error: <code class="literal">1012</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANT_FIND_SYSTEM_REC</code>)
    </p><p>
      Message: Can't read record in system table
    </p></li><li><p>
      Error: <code class="literal">1013</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANT_GET_STAT</code>)
    </p><p>
      Message: Can't get status of '%s' (errno: %d)
    </p></li><li><p>
      Error: <code class="literal">1014</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANT_GET_WD</code>)
    </p><p>
      Message: Can't get working directory (errno: %d)
    </p></li><li><p>
      Error: <code class="literal">1015</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANT_LOCK</code>)
    </p><p>
      Message: Can't lock file (errno: %d)
    </p></li><li><p>
      Error: <code class="literal">1016</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANT_OPEN_FILE</code>)
    </p><p>
      Message: Can't open file: '%s' (errno: %d)
    </p></li><li><p>
      Error: <code class="literal">1017</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_FILE_NOT_FOUND</code>)
    </p><p>
      Message: Can't find file: '%s' (errno: %d)
    </p></li><li><p>
      Error: <code class="literal">1018</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANT_READ_DIR</code>)
    </p><p>
      Message: Can't read dir of '%s' (errno: %d)
    </p></li><li><p>
      Error: <code class="literal">1019</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANT_SET_WD</code>)
    </p><p>
      Message: Can't change dir to '%s' (errno: %d)
    </p></li><li><p>
      Error: <code class="literal">1020</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CHECKREAD</code>)
    </p><p>
      Message: Record has changed since last read in table '%s'
    </p></li><li><p>
      Error: <code class="literal">1021</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_DISK_FULL</code>)
    </p><p>
      Message: Disk full (%s); waiting for someone to free some space...
    </p></li><li><p>
      Error: <code class="literal">1022</code> SQLSTATE: <code class="literal">23000</code>
      (<code class="literal">ER_DUP_KEY</code>)
    </p><p>
      Message: Can't write; duplicate key in table '%s'
    </p></li><li><p>
      Error: <code class="literal">1023</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_ERROR_ON_CLOSE</code>)
    </p><p>
      Message: Error on close of '%s' (errno: %d)
    </p></li><li><p>
      Error: <code class="literal">1024</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_ERROR_ON_READ</code>)
    </p><p>
      Message: Error reading file '%s' (errno: %d)
    </p></li><li><p>
      Error: <code class="literal">1025</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_ERROR_ON_RENAME</code>)
    </p><p>
      Message: Error on rename of '%s' to '%s' (errno: %d)
    </p></li><li><p>
      Error: <code class="literal">1026</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_ERROR_ON_WRITE</code>)
    </p><p>
      Message: Error writing file '%s' (errno: %d)
    </p></li><li><p>
      Error: <code class="literal">1027</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_FILE_USED</code>)
    </p><p>
      Message: '%s' is locked against change
    </p></li><li><p>
      Error: <code class="literal">1028</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_FILSORT_ABORT</code>)
    </p><p>
      Message: Sort aborted
    </p></li><li><p>
      Error: <code class="literal">1029</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_FORM_NOT_FOUND</code>)
    </p><p>
      Message: View '%s' doesn't exist for '%s'
    </p></li><li><p>
      Error: <code class="literal">1030</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_GET_ERRNO</code>)
    </p><p>
      Message: Got error %d from storage engine
    </p></li><li><p>
      Error: <code class="literal">1031</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_ILLEGAL_HA</code>)
    </p><p>
      Message: Table storage engine for '%s' doesn't have this option
    </p></li><li><p>
      Error: <code class="literal">1032</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_KEY_NOT_FOUND</code>)
    </p><p>
      Message: Can't find record in '%s'
    </p></li><li><p>
      Error: <code class="literal">1033</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_NOT_FORM_FILE</code>)
    </p><p>
      Message: Incorrect information in file: '%s'
    </p></li><li><p>
      Error: <code class="literal">1034</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_NOT_KEYFILE</code>)
    </p><p>
      Message: Incorrect key file for table '%s'; try to repair it
    </p></li><li><p>
      Error: <code class="literal">1035</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_OLD_KEYFILE</code>)
    </p><p>
      Message: Old key file for table '%s'; repair it!
    </p></li><li><p>
      Error: <code class="literal">1036</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_OPEN_AS_READONLY</code>)
    </p><p>
      Message: Table '%s' is read only
    </p></li><li><p>
      Error: <code class="literal">1037</code> SQLSTATE: <code class="literal">HY001</code>
      (<code class="literal">ER_OUTOFMEMORY</code>)
    </p><p>
      Message: Out of memory; restart server and try again (needed %d
      bytes)
    </p></li><li><p>
      Error: <code class="literal">1038</code> SQLSTATE: <code class="literal">HY001</code>
      (<code class="literal">ER_OUT_OF_SORTMEMORY</code>)
    </p><p>
      Message: Out of sort memory; increase server sort buffer size
    </p></li><li><p>
      Error: <code class="literal">1039</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_UNEXPECTED_EOF</code>)
    </p><p>
      Message: Unexpected EOF found when reading file '%s' (errno: %d)
    </p></li><li><p>
      Error: <code class="literal">1040</code> SQLSTATE: <code class="literal">08004</code>
      (<code class="literal">ER_CON_COUNT_ERROR</code>)
    </p><p>
      Message: Too many connections
    </p></li><li><p>
      Error: <code class="literal">1041</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_OUT_OF_RESOURCES</code>)
    </p><p>
      Message: Out of memory; check if mysqld or some other process uses
      all available memory; if not, you may have to use 'ulimit' to
      allow mysqld to use more memory or you can add more swap space
    </p></li><li><p>
      Error: <code class="literal">1042</code> SQLSTATE: <code class="literal">08S01</code>
      (<code class="literal">ER_BAD_HOST_ERROR</code>)
    </p><p>
      Message: Can't get hostname for your address
    </p></li><li><p>
      Error: <code class="literal">1043</code> SQLSTATE: <code class="literal">08S01</code>
      (<code class="literal">ER_HANDSHAKE_ERROR</code>)
    </p><p>
      Message: Bad handshake
    </p></li><li><p>
      Error: <code class="literal">1044</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_DBACCESS_DENIED_ERROR</code>)
    </p><p>
      Message: Access denied for user '%s'@'%s' to database '%s'
    </p></li><li><p>
      Error: <code class="literal">1045</code> SQLSTATE: <code class="literal">28000</code>
      (<code class="literal">ER_ACCESS_DENIED_ERROR</code>)
    </p><p>
      Message: Access denied for user '%s'@'%s' (using password: %s)
    </p></li><li><p>
      Error: <code class="literal">1046</code> SQLSTATE: <code class="literal">3D000</code>
      (<code class="literal">ER_NO_DB_ERROR</code>)
    </p><p>
      Message: No database selected
    </p></li><li><p>
      Error: <code class="literal">1047</code> SQLSTATE: <code class="literal">08S01</code>
      (<code class="literal">ER_UNKNOWN_COM_ERROR</code>)
    </p><p>
      Message: Unknown command
    </p></li><li><p>
      Error: <code class="literal">1048</code> SQLSTATE: <code class="literal">23000</code>
      (<code class="literal">ER_BAD_NULL_ERROR</code>)
    </p><p>
      Message: Column '%s' cannot be null
    </p></li><li><p>
      Error: <code class="literal">1049</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_BAD_DB_ERROR</code>)
    </p><p>
      Message: Unknown database '%s'
    </p></li><li><p>
      Error: <code class="literal">1050</code> SQLSTATE: <code class="literal">42S01</code>
      (<code class="literal">ER_TABLE_EXISTS_ERROR</code>)
    </p><p>
      Message: Table '%s' already exists
    </p></li><li><p>
      Error: <code class="literal">1051</code> SQLSTATE: <code class="literal">42S02</code>
      (<code class="literal">ER_BAD_TABLE_ERROR</code>)
    </p><p>
      Message: Unknown table '%s'
    </p></li><li><p>
      Error: <code class="literal">1052</code> SQLSTATE: <code class="literal">23000</code>
      (<code class="literal">ER_NON_UNIQ_ERROR</code>)
    </p><p>
      Message: Column '%s' in %s is ambiguous
    </p></li><li><p>
      Error: <code class="literal">1053</code> SQLSTATE: <code class="literal">08S01</code>
      (<code class="literal">ER_SERVER_SHUTDOWN</code>)
    </p><p>
      Message: Server shutdown in progress
    </p></li><li><p>
      Error: <code class="literal">1054</code> SQLSTATE: <code class="literal">42S22</code>
      (<code class="literal">ER_BAD_FIELD_ERROR</code>)
    </p><p>
      Message: Unknown column '%s' in '%s'
    </p></li><li><p>
      Error: <code class="literal">1055</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_WRONG_FIELD_WITH_GROUP</code>)
    </p><p>
      Message: '%s' isn't in GROUP BY
    </p></li><li><p>
      Error: <code class="literal">1056</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_WRONG_GROUP_FIELD</code>)
    </p><p>
      Message: Can't group on '%s'
    </p></li><li><p>
      Error: <code class="literal">1057</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_WRONG_SUM_SELECT</code>)
    </p><p>
      Message: Statement has sum functions and columns in same statement
    </p></li><li><p>
      Error: <code class="literal">1058</code> SQLSTATE: <code class="literal">21S01</code>
      (<code class="literal">ER_WRONG_VALUE_COUNT</code>)
    </p><p>
      Message: Column count doesn't match value count
    </p></li><li><p>
      Error: <code class="literal">1059</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_TOO_LONG_IDENT</code>)
    </p><p>
      Message: Identifier name '%s' is too long
    </p></li><li><p>
      Error: <code class="literal">1060</code> SQLSTATE: <code class="literal">42S21</code>
      (<code class="literal">ER_DUP_FIELDNAME</code>)
    </p><p>
      Message: Duplicate column name '%s'
    </p></li><li><p>
      Error: <code class="literal">1061</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_DUP_KEYNAME</code>)
    </p><p>
      Message: Duplicate key name '%s'
    </p></li><li><p>
      Error: <code class="literal">1062</code> SQLSTATE: <code class="literal">23000</code>
      (<code class="literal">ER_DUP_ENTRY</code>)
    </p><p>
      Message: Duplicate entry '%s' for key %d
    </p></li><li><p>
      Error: <code class="literal">1063</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_WRONG_FIELD_SPEC</code>)
    </p><p>
      Message: Incorrect column specifier for column '%s'
    </p></li><li><p>
      Error: <code class="literal">1064</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_PARSE_ERROR</code>)
    </p><p>
      Message: %s near '%s' at line %d
    </p></li><li><p>
      Error: <code class="literal">1065</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_EMPTY_QUERY</code>)
    </p><p>
      Message: Query was empty
    </p></li><li><p>
      Error: <code class="literal">1066</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_NONUNIQ_TABLE</code>)
    </p><p>
      Message: Not unique table/alias: '%s'
    </p></li><li><p>
      Error: <code class="literal">1067</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_INVALID_DEFAULT</code>)
    </p><p>
      Message: Invalid default value for '%s'
    </p></li><li><p>
      Error: <code class="literal">1068</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_MULTIPLE_PRI_KEY</code>)
    </p><p>
      Message: Multiple primary key defined
    </p></li><li><p>
      Error: <code class="literal">1069</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_TOO_MANY_KEYS</code>)
    </p><p>
      Message: Too many keys specified; max %d keys allowed
    </p></li><li><p>
      Error: <code class="literal">1070</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_TOO_MANY_KEY_PARTS</code>)
    </p><p>
      Message: Too many key parts specified; max %d parts allowed
    </p></li><li><p>
      Error: <code class="literal">1071</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_TOO_LONG_KEY</code>)
    </p><p>
      Message: Specified key was too long; max key length is %d bytes
    </p></li><li><p>
      Error: <code class="literal">1072</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_KEY_COLUMN_DOES_NOT_EXITS</code>)
    </p><p>
      Message: Key column '%s' doesn't exist in table
    </p></li><li><p>
      Error: <code class="literal">1073</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_BLOB_USED_AS_KEY</code>)
    </p><p>
      Message: BLOB column '%s' can't be used in key specification with
      the used table type
    </p></li><li><p>
      Error: <code class="literal">1074</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_TOO_BIG_FIELDLENGTH</code>)
    </p><p>
      Message: Column length too big for column '%s' (max = %d); use
      BLOB or TEXT instead
    </p></li><li><p>
      Error: <code class="literal">1075</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_WRONG_AUTO_KEY</code>)
    </p><p>
      Message: Incorrect table definition; there can be only one auto
      column and it must be defined as a key
    </p></li><li><p>
      Error: <code class="literal">1076</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_READY</code>)
    </p><p>
      Message: %s: ready for connections. Version: '%s' socket: '%s'
      port: %d
    </p></li><li><p>
      Error: <code class="literal">1077</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_NORMAL_SHUTDOWN</code>)
    </p><p>
      Message: %s: Normal shutdown
    </p></li><li><p>
      Error: <code class="literal">1078</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_GOT_SIGNAL</code>)
    </p><p>
      Message: %s: Got signal %d. Aborting!
    </p></li><li><p>
      Error: <code class="literal">1079</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_SHUTDOWN_COMPLETE</code>)
    </p><p>
      Message: %s: Shutdown complete
    </p></li><li><p>
      Error: <code class="literal">1080</code> SQLSTATE: <code class="literal">08S01</code>
      (<code class="literal">ER_FORCING_CLOSE</code>)
    </p><p>
      Message: %s: Forcing close of thread %ld user: '%s'
    </p></li><li><p>
      Error: <code class="literal">1081</code> SQLSTATE: <code class="literal">08S01</code>
      (<code class="literal">ER_IPSOCK_ERROR</code>)
    </p><p>
      Message: Can't create IP socket
    </p></li><li><p>
      Error: <code class="literal">1082</code> SQLSTATE: <code class="literal">42S12</code>
      (<code class="literal">ER_NO_SUCH_INDEX</code>)
    </p><p>
      Message: Table '%s' has no index like the one used in CREATE
      INDEX; recreate the table
    </p></li><li><p>
      Error: <code class="literal">1083</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_WRONG_FIELD_TERMINATORS</code>)
    </p><p>
      Message: Field separator argument is not what is expected; check
      the manual
    </p></li><li><p>
      Error: <code class="literal">1084</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_BLOBS_AND_NO_TERMINATED</code>)
    </p><p>
      Message: You can't use fixed rowlength with BLOBs; please use
      'fields terminated by'
    </p></li><li><p>
      Error: <code class="literal">1085</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_TEXTFILE_NOT_READABLE</code>)
    </p><p>
      Message: The file '%s' must be in the database directory or be
      readable by all
    </p></li><li><p>
      Error: <code class="literal">1086</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_FILE_EXISTS_ERROR</code>)
    </p><p>
      Message: File '%s' already exists
    </p></li><li><p>
      Error: <code class="literal">1087</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_LOAD_INFO</code>)
    </p><p>
      Message: Records: %ld Deleted: %ld Skipped: %ld Warnings: %ld
    </p></li><li><p>
      Error: <code class="literal">1088</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_ALTER_INFO</code>)
    </p><p>
      Message: Records: %ld Duplicates: %ld
    </p></li><li><p>
      Error: <code class="literal">1089</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_WRONG_SUB_KEY</code>)
    </p><p>
      Message: Incorrect sub part key; the used key part isn't a string,
      the used length is longer than the key part, or the storage engine
      doesn't support unique sub keys
    </p></li><li><p>
      Error: <code class="literal">1090</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_CANT_REMOVE_ALL_FIELDS</code>)
    </p><p>
      Message: You can't delete all columns with ALTER TABLE; use DROP
      TABLE instead
    </p></li><li><p>
      Error: <code class="literal">1091</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_CANT_DROP_FIELD_OR_KEY</code>)
    </p><p>
      Message: Can't DROP '%s'; check that column/key exists
    </p></li><li><p>
      Error: <code class="literal">1092</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_INSERT_INFO</code>)
    </p><p>
      Message: Records: %ld Duplicates: %ld Warnings: %ld
    </p></li><li><p>
      Error: <code class="literal">1093</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_UPDATE_TABLE_USED</code>)
    </p><p>
      Message: You can't specify target table '%s' for update in FROM
      clause
    </p></li><li><p>
      Error: <code class="literal">1094</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_NO_SUCH_THREAD</code>)
    </p><p>
      Message: Unknown thread id: %lu
    </p></li><li><p>
      Error: <code class="literal">1095</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_KILL_DENIED_ERROR</code>)
    </p><p>
      Message: You are not owner of thread %lu
    </p></li><li><p>
      Error: <code class="literal">1096</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_NO_TABLES_USED</code>)
    </p><p>
      Message: No tables used
    </p></li><li><p>
      Error: <code class="literal">1097</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_TOO_BIG_SET</code>)
    </p><p>
      Message: Too many strings for column %s and SET
    </p></li><li><p>
      Error: <code class="literal">1098</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_NO_UNIQUE_LOGFILE</code>)
    </p><p>
      Message: Can't generate a unique log-filename %s.(1-999)
    </p></li><li><p>
      Error: <code class="literal">1099</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_TABLE_NOT_LOCKED_FOR_WRITE</code>)
    </p><p>
      Message: Table '%s' was locked with a READ lock and can't be
      updated
    </p></li><li><p>
      Error: <code class="literal">1100</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_TABLE_NOT_LOCKED</code>)
    </p><p>
      Message: Table '%s' was not locked with LOCK TABLES
    </p></li><li><p>
      Error: <code class="literal">1101</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_BLOB_CANT_HAVE_DEFAULT</code>)
    </p><p>
      Message: BLOB/TEXT column '%s' can't have a default value
    </p></li><li><p>
      Error: <code class="literal">1102</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_WRONG_DB_NAME</code>)
    </p><p>
      Message: Incorrect database name '%s'
    </p></li><li><p>
      Error: <code class="literal">1103</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_WRONG_TABLE_NAME</code>)
    </p><p>
      Message: Incorrect table name '%s'
    </p></li><li><p>
      Error: <code class="literal">1104</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_TOO_BIG_SELECT</code>)
    </p><p>
      Message: The SELECT would examine more than MAX_JOIN_SIZE rows;
      check your WHERE and use SET SQL_BIG_SELECTS=1 or SET
      SQL_MAX_JOIN_SIZE=# if the SELECT is okay
    </p></li><li><p>
      Error: <code class="literal">1105</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_UNKNOWN_ERROR</code>)
    </p><p>
      Message: Unknown error
    </p></li><li><p>
      Error: <code class="literal">1106</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_UNKNOWN_PROCEDURE</code>)
    </p><p>
      Message: Unknown procedure '%s'
    </p></li><li><p>
      Error: <code class="literal">1107</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_WRONG_PARAMCOUNT_TO_PROCEDURE</code>)
    </p><p>
      Message: Incorrect parameter count to procedure '%s'
    </p></li><li><p>
      Error: <code class="literal">1108</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_WRONG_PARAMETERS_TO_PROCEDURE</code>)
    </p><p>
      Message: Incorrect parameters to procedure '%s'
    </p></li><li><p>
      Error: <code class="literal">1109</code> SQLSTATE: <code class="literal">42S02</code>
      (<code class="literal">ER_UNKNOWN_TABLE</code>)
    </p><p>
      Message: Unknown table '%s' in %s
    </p></li><li><p>
      Error: <code class="literal">1110</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_FIELD_SPECIFIED_TWICE</code>)
    </p><p>
      Message: Column '%s' specified twice
    </p></li><li><p>
      Error: <code class="literal">1111</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_INVALID_GROUP_FUNC_USE</code>)
    </p><p>
      Message: Invalid use of group function
    </p></li><li><p>
      Error: <code class="literal">1112</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_UNSUPPORTED_EXTENSION</code>)
    </p><p>
      Message: Table '%s' uses an extension that doesn't exist in this
      MySQL version
    </p></li><li><p>
      Error: <code class="literal">1113</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_TABLE_MUST_HAVE_COLUMNS</code>)
    </p><p>
      Message: A table must have at least 1 column
    </p></li><li><p>
      Error: <code class="literal">1114</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_RECORD_FILE_FULL</code>)
    </p><p>
      Message: The table '%s' is full
    </p></li><li><p>
      Error: <code class="literal">1115</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_UNKNOWN_CHARACTER_SET</code>)
    </p><p>
      Message: Unknown character set: '%s'
    </p></li><li><p>
      Error: <code class="literal">1116</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_TOO_MANY_TABLES</code>)
    </p><p>
      Message: Too many tables; MySQL can only use %d tables in a join
    </p></li><li><p>
      Error: <code class="literal">1117</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_TOO_MANY_FIELDS</code>)
    </p><p>
      Message: Too many columns
    </p></li><li><p>
      Error: <code class="literal">1118</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_TOO_BIG_ROWSIZE</code>)
    </p><p>
      Message: Row size too large. The maximum row size for the used
      table type, not counting BLOBs, is %ld. You have to change some
      columns to TEXT or BLOBs
    </p></li><li><p>
      Error: <code class="literal">1119</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_STACK_OVERRUN</code>)
    </p><p>
      Message: Thread stack overrun: Used: %ld of a %ld stack. Use
      'mysqld -O thread_stack=#' to specify a bigger stack if needed
    </p></li><li><p>
      Error: <code class="literal">1120</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_WRONG_OUTER_JOIN</code>)
    </p><p>
      Message: Cross dependency found in OUTER JOIN; examine your ON
      conditions
    </p></li><li><p>
      Error: <code class="literal">1121</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_NULL_COLUMN_IN_INDEX</code>)
    </p><p>
      Message: Column '%s' is used with UNIQUE or INDEX but is not
      defined as NOT NULL
    </p></li><li><p>
      Error: <code class="literal">1122</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANT_FIND_UDF</code>)
    </p><p>
      Message: Can't load function '%s'
    </p></li><li><p>
      Error: <code class="literal">1123</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANT_INITIALIZE_UDF</code>)
    </p><p>
      Message: Can't initialize function '%s'; %s
    </p></li><li><p>
      Error: <code class="literal">1124</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_UDF_NO_PATHS</code>)
    </p><p>
      Message: No paths allowed for shared library
    </p></li><li><p>
      Error: <code class="literal">1125</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_UDF_EXISTS</code>)
    </p><p>
      Message: Function '%s' already exists
    </p></li><li><p>
      Error: <code class="literal">1126</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANT_OPEN_LIBRARY</code>)
    </p><p>
      Message: Can't open shared library '%s' (errno: %d %s)
    </p></li><li><p>
      Error: <code class="literal">1127</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANT_FIND_DL_ENTRY</code>)
    </p><p>
      Message: Can't find function '%s' in library
    </p></li><li><p>
      Error: <code class="literal">1128</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_FUNCTION_NOT_DEFINED</code>)
    </p><p>
      Message: Function '%s' is not defined
    </p></li><li><p>
      Error: <code class="literal">1129</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_HOST_IS_BLOCKED</code>)
    </p><p>
      Message: Host '%s' is blocked because of many connection errors;
      unblock with 'mysqladmin flush-hosts'
    </p></li><li><p>
      Error: <code class="literal">1130</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_HOST_NOT_PRIVILEGED</code>)
    </p><p>
      Message: Host '%s' is not allowed to connect to this MySQL server
    </p></li><li><p>
      Error: <code class="literal">1131</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_PASSWORD_ANONYMOUS_USER</code>)
    </p><p>
      Message: You are using MySQL as an anonymous user and anonymous
      users are not allowed to change passwords
    </p></li><li><p>
      Error: <code class="literal">1132</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_PASSWORD_NOT_ALLOWED</code>)
    </p><p>
      Message: You must have privileges to update tables in the mysql
      database to be able to change passwords for others
    </p></li><li><p>
      Error: <code class="literal">1133</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_PASSWORD_NO_MATCH</code>)
    </p><p>
      Message: Can't find any matching row in the user table
    </p></li><li><p>
      Error: <code class="literal">1134</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_UPDATE_INFO</code>)
    </p><p>
      Message: Rows matched: %ld Changed: %ld Warnings: %ld
    </p></li><li><p>
      Error: <code class="literal">1135</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANT_CREATE_THREAD</code>)
    </p><p>
      Message: Can't create a new thread (errno %d); if you are not out
      of available memory, you can consult the manual for a possible
      OS-dependent bug
    </p></li><li><p>
      Error: <code class="literal">1136</code> SQLSTATE: <code class="literal">21S01</code>
      (<code class="literal">ER_WRONG_VALUE_COUNT_ON_ROW</code>)
    </p><p>
      Message: Column count doesn't match value count at row %ld
    </p></li><li><p>
      Error: <code class="literal">1137</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANT_REOPEN_TABLE</code>)
    </p><p>
      Message: Can't reopen table: '%s'
    </p></li><li><p>
      Error: <code class="literal">1138</code> SQLSTATE: <code class="literal">22004</code>
      (<code class="literal">ER_INVALID_USE_OF_NULL</code>)
    </p><p>
      Message: Invalid use of NULL value
    </p></li><li><p>
      Error: <code class="literal">1139</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_REGEXP_ERROR</code>)
    </p><p>
      Message: Got error '%s' from regexp
    </p></li><li><p>
      Error: <code class="literal">1140</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_MIX_OF_GROUP_FUNC_AND_FIELDS</code>)
    </p><p>
      Message: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no
      GROUP columns is illegal if there is no GROUP BY clause
    </p></li><li><p>
      Error: <code class="literal">1141</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_NONEXISTING_GRANT</code>)
    </p><p>
      Message: There is no such grant defined for user '%s' on host '%s'
    </p></li><li><p>
      Error: <code class="literal">1142</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_TABLEACCESS_DENIED_ERROR</code>)
    </p><p>
      Message: %s command denied to user '%s'@'%s' for table '%s'
    </p></li><li><p>
      Error: <code class="literal">1143</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_COLUMNACCESS_DENIED_ERROR</code>)
    </p><p>
      Message: %s command denied to user '%s'@'%s' for column '%s' in
      table '%s'
    </p></li><li><p>
      Error: <code class="literal">1144</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_ILLEGAL_GRANT_FOR_TABLE</code>)
    </p><p>
      Message: Illegal GRANT/REVOKE command; please consult the manual
      to see which privileges can be used
    </p></li><li><p>
      Error: <code class="literal">1145</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_GRANT_WRONG_HOST_OR_USER</code>)
    </p><p>
      Message: The host or user argument to GRANT is too long
    </p></li><li><p>
      Error: <code class="literal">1146</code> SQLSTATE: <code class="literal">42S02</code>
      (<code class="literal">ER_NO_SUCH_TABLE</code>)
    </p><p>
      Message: Table '%s.%s' doesn't exist
    </p></li><li><p>
      Error: <code class="literal">1147</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_NONEXISTING_TABLE_GRANT</code>)
    </p><p>
      Message: There is no such grant defined for user '%s' on host '%s'
      on table '%s'
    </p></li><li><p>
      Error: <code class="literal">1148</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_NOT_ALLOWED_COMMAND</code>)
    </p><p>
      Message: The used command is not allowed with this MySQL version
    </p></li><li><p>
      Error: <code class="literal">1149</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SYNTAX_ERROR</code>)
    </p><p>
      Message: You have an error in your SQL syntax; check the manual
      that corresponds to your MySQL server version for the right syntax
      to use
    </p></li><li><p>
      Error: <code class="literal">1150</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_DELAYED_CANT_CHANGE_LOCK</code>)
    </p><p>
      Message: Delayed insert thread couldn't get requested lock for
      table %s
    </p></li><li><p>
      Error: <code class="literal">1151</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_TOO_MANY_DELAYED_THREADS</code>)
    </p><p>
      Message: Too many delayed threads in use
    </p></li><li><p>
      Error: <code class="literal">1152</code> SQLSTATE: <code class="literal">08S01</code>
      (<code class="literal">ER_ABORTING_CONNECTION</code>)
    </p><p>
      Message: Aborted connection %ld to db: '%s' user: '%s' (%s)
    </p></li><li><p>
      Error: <code class="literal">1153</code> SQLSTATE: <code class="literal">08S01</code>
      (<code class="literal">ER_NET_PACKET_TOO_LARGE</code>)
    </p><p>
      Message: Got a packet bigger than 'max_allowed_packet' bytes
    </p></li><li><p>
      Error: <code class="literal">1154</code> SQLSTATE: <code class="literal">08S01</code>
      (<code class="literal">ER_NET_READ_ERROR_FROM_PIPE</code>)
    </p><p>
      Message: Got a read error from the connection pipe
    </p></li><li><p>
      Error: <code class="literal">1155</code> SQLSTATE: <code class="literal">08S01</code>
      (<code class="literal">ER_NET_FCNTL_ERROR</code>)
    </p><p>
      Message: Got an error from fcntl()
    </p></li><li><p>
      Error: <code class="literal">1156</code> SQLSTATE: <code class="literal">08S01</code>
      (<code class="literal">ER_NET_PACKETS_OUT_OF_ORDER</code>)
    </p><p>
      Message: Got packets out of order
    </p></li><li><p>
      Error: <code class="literal">1157</code> SQLSTATE: <code class="literal">08S01</code>
      (<code class="literal">ER_NET_UNCOMPRESS_ERROR</code>)
    </p><p>
      Message: Couldn't uncompress communication packet
    </p></li><li><p>
      Error: <code class="literal">1158</code> SQLSTATE: <code class="literal">08S01</code>
      (<code class="literal">ER_NET_READ_ERROR</code>)
    </p><p>
      Message: Got an error reading communication packets
    </p></li><li><p>
      Error: <code class="literal">1159</code> SQLSTATE: <code class="literal">08S01</code>
      (<code class="literal">ER_NET_READ_INTERRUPTED</code>)
    </p><p>
      Message: Got timeout reading communication packets
    </p></li><li><p>
      Error: <code class="literal">1160</code> SQLSTATE: <code class="literal">08S01</code>
      (<code class="literal">ER_NET_ERROR_ON_WRITE</code>)
    </p><p>
      Message: Got an error writing communication packets
    </p></li><li><p>
      Error: <code class="literal">1161</code> SQLSTATE: <code class="literal">08S01</code>
      (<code class="literal">ER_NET_WRITE_INTERRUPTED</code>)
    </p><p>
      Message: Got timeout writing communication packets
    </p></li><li><p>
      Error: <code class="literal">1162</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_TOO_LONG_STRING</code>)
    </p><p>
      Message: Result string is longer than 'max_allowed_packet' bytes
    </p></li><li><p>
      Error: <code class="literal">1163</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_TABLE_CANT_HANDLE_BLOB</code>)
    </p><p>
      Message: The used table type doesn't support BLOB/TEXT columns
    </p></li><li><p>
      Error: <code class="literal">1164</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_TABLE_CANT_HANDLE_AUTO_INCREMENT</code>)
    </p><p>
      Message: The used table type doesn't support AUTO_INCREMENT
      columns
    </p></li><li><p>
      Error: <code class="literal">1165</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_DELAYED_INSERT_TABLE_LOCKED</code>)
    </p><p>
      Message: INSERT DELAYED can't be used with table '%s' because it
      is locked with LOCK TABLES
    </p></li><li><p>
      Error: <code class="literal">1166</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_WRONG_COLUMN_NAME</code>)
    </p><p>
      Message: Incorrect column name '%s'
    </p></li><li><p>
      Error: <code class="literal">1167</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_WRONG_KEY_COLUMN</code>)
    </p><p>
      Message: The used storage engine can't index column '%s'
    </p></li><li><p>
      Error: <code class="literal">1168</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_WRONG_MRG_TABLE</code>)
    </p><p>
      Message: Unable to open underlying table which is differently
      defined or of non-MyISAM type or doesn't exist
    </p></li><li><p>
      Error: <code class="literal">1169</code> SQLSTATE: <code class="literal">23000</code>
      (<code class="literal">ER_DUP_UNIQUE</code>)
    </p><p>
      Message: Can't write, because of unique constraint, to table '%s'
    </p></li><li><p>
      Error: <code class="literal">1170</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_BLOB_KEY_WITHOUT_LENGTH</code>)
    </p><p>
      Message: BLOB/TEXT column '%s' used in key specification without a
      key length
    </p></li><li><p>
      Error: <code class="literal">1171</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_PRIMARY_CANT_HAVE_NULL</code>)
    </p><p>
      Message: All parts of a PRIMARY KEY must be NOT NULL; if you need
      NULL in a key, use UNIQUE instead
    </p></li><li><p>
      Error: <code class="literal">1172</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_TOO_MANY_ROWS</code>)
    </p><p>
      Message: Result consisted of more than one row
    </p></li><li><p>
      Error: <code class="literal">1173</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_REQUIRES_PRIMARY_KEY</code>)
    </p><p>
      Message: This table type requires a primary key
    </p></li><li><p>
      Error: <code class="literal">1174</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_NO_RAID_COMPILED</code>)
    </p><p>
      Message: This version of MySQL is not compiled with RAID support
    </p></li><li><p>
      Error: <code class="literal">1175</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE</code>)
    </p><p>
      Message: You are using safe update mode and you tried to update a
      table without a WHERE that uses a KEY column
    </p></li><li><p>
      Error: <code class="literal">1176</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_KEY_DOES_NOT_EXITS</code>)
    </p><p>
      Message: Key '%s' doesn't exist in table '%s'
    </p></li><li><p>
      Error: <code class="literal">1177</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_CHECK_NO_SUCH_TABLE</code>)
    </p><p>
      Message: Can't open table
    </p></li><li><p>
      Error: <code class="literal">1178</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_CHECK_NOT_IMPLEMENTED</code>)
    </p><p>
      Message: The storage engine for the table doesn't support %s
    </p></li><li><p>
      Error: <code class="literal">1179</code> SQLSTATE: <code class="literal">25000</code>
      (<code class="literal">ER_CANT_DO_THIS_DURING_AN_TRANSACTION</code>)
    </p><p>
      Message: You are not allowed to execute this command in a
      transaction
    </p></li><li><p>
      Error: <code class="literal">1180</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_ERROR_DURING_COMMIT</code>)
    </p><p>
      Message: Got error %d during COMMIT
    </p></li><li><p>
      Error: <code class="literal">1181</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_ERROR_DURING_ROLLBACK</code>)
    </p><p>
      Message: Got error %d during ROLLBACK
    </p></li><li><p>
      Error: <code class="literal">1182</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_ERROR_DURING_FLUSH_LOGS</code>)
    </p><p>
      Message: Got error %d during FLUSH_LOGS
    </p></li><li><p>
      Error: <code class="literal">1183</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_ERROR_DURING_CHECKPOINT</code>)
    </p><p>
      Message: Got error %d during CHECKPOINT
    </p></li><li><p>
      Error: <code class="literal">1184</code> SQLSTATE: <code class="literal">08S01</code>
      (<code class="literal">ER_NEW_ABORTING_CONNECTION</code>)
    </p><p>
      Message: Aborted connection %ld to db: '%s' user: '%s' host: '%s'
      (%s)
    </p></li><li><p>
      Error: <code class="literal">1185</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_DUMP_NOT_IMPLEMENTED</code>)
    </p><p>
      Message: The storage engine for the table does not support binary
      table dump
    </p></li><li><p>
      Error: <code class="literal">1186</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_FLUSH_MASTER_BINLOG_CLOSED</code>)
    </p><p>
      Message: Binlog closed, cannot RESET MASTER
    </p></li><li><p>
      Error: <code class="literal">1187</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_INDEX_REBUILD</code>)
    </p><p>
      Message: Failed rebuilding the index of dumped table '%s'
    </p></li><li><p>
      Error: <code class="literal">1188</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_MASTER</code>)
    </p><p>
      Message: Error from master: '%s'
    </p></li><li><p>
      Error: <code class="literal">1189</code> SQLSTATE: <code class="literal">08S01</code>
      (<code class="literal">ER_MASTER_NET_READ</code>)
    </p><p>
      Message: Net error reading from master
    </p></li><li><p>
      Error: <code class="literal">1190</code> SQLSTATE: <code class="literal">08S01</code>
      (<code class="literal">ER_MASTER_NET_WRITE</code>)
    </p><p>
      Message: Net error writing to master
    </p></li><li><p>
      Error: <code class="literal">1191</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_FT_MATCHING_KEY_NOT_FOUND</code>)
    </p><p>
      Message: Can't find FULLTEXT index matching the column list
    </p></li><li><p>
      Error: <code class="literal">1192</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_LOCK_OR_ACTIVE_TRANSACTION</code>)
    </p><p>
      Message: Can't execute the given command because you have active
      locked tables or an active transaction
    </p></li><li><p>
      Error: <code class="literal">1193</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_UNKNOWN_SYSTEM_VARIABLE</code>)
    </p><p>
      Message: Unknown system variable '%s'
    </p></li><li><p>
      Error: <code class="literal">1194</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CRASHED_ON_USAGE</code>)
    </p><p>
      Message: Table '%s' is marked as crashed and should be repaired
    </p></li><li><p>
      Error: <code class="literal">1195</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CRASHED_ON_REPAIR</code>)
    </p><p>
      Message: Table '%s' is marked as crashed and last (automatic?)
      repair failed
    </p></li><li><p>
      Error: <code class="literal">1196</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_WARNING_NOT_COMPLETE_ROLLBACK</code>)
    </p><p>
      Message: Some non-transactional changed tables couldn't be rolled
      back
    </p></li><li><p>
      Error: <code class="literal">1197</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_TRANS_CACHE_FULL</code>)
    </p><p>
      Message: Multi-statement transaction required more than
      'max_binlog_cache_size' bytes of storage; increase this mysqld
      variable and try again
    </p></li><li><p>
      Error: <code class="literal">1198</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_SLAVE_MUST_STOP</code>)
    </p><p>
      Message: This operation cannot be performed with a running slave;
      run STOP SLAVE first
    </p></li><li><p>
      Error: <code class="literal">1199</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_SLAVE_NOT_RUNNING</code>)
    </p><p>
      Message: This operation requires a running slave; configure slave
      and do START SLAVE
    </p></li><li><p>
      Error: <code class="literal">1200</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_BAD_SLAVE</code>)
    </p><p>
      Message: The server is not configured as slave; fix in config file
      or with CHANGE MASTER TO
    </p></li><li><p>
      Error: <code class="literal">1201</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_MASTER_INFO</code>)
    </p><p>
      Message: Could not initialize master info structure; more error
      messages can be found in the MySQL error log
    </p></li><li><p>
      Error: <code class="literal">1202</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_SLAVE_THREAD</code>)
    </p><p>
      Message: Could not create slave thread; check system resources
    </p></li><li><p>
      Error: <code class="literal">1203</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_TOO_MANY_USER_CONNECTIONS</code>)
    </p><p>
      Message: User %s already has more than 'max_user_connections'
      active connections
    </p></li><li><p>
      Error: <code class="literal">1204</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_SET_CONSTANTS_ONLY</code>)
    </p><p>
      Message: You may only use constant expressions with SET
    </p></li><li><p>
      Error: <code class="literal">1205</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_LOCK_WAIT_TIMEOUT</code>)
    </p><p>
      Message: Lock wait timeout exceeded; try restarting transaction
    </p></li><li><p>
      Error: <code class="literal">1206</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_LOCK_TABLE_FULL</code>)
    </p><p>
      Message: The total number of locks exceeds the lock table size
    </p></li><li><p>
      Error: <code class="literal">1207</code> SQLSTATE: <code class="literal">25000</code>
      (<code class="literal">ER_READ_ONLY_TRANSACTION</code>)
    </p><p>
      Message: Update locks cannot be acquired during a READ UNCOMMITTED
      transaction
    </p></li><li><p>
      Error: <code class="literal">1208</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_DROP_DB_WITH_READ_LOCK</code>)
    </p><p>
      Message: DROP DATABASE not allowed while thread is holding global
      read lock
    </p></li><li><p>
      Error: <code class="literal">1209</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CREATE_DB_WITH_READ_LOCK</code>)
    </p><p>
      Message: CREATE DATABASE not allowed while thread is holding
      global read lock
    </p></li><li><p>
      Error: <code class="literal">1210</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_WRONG_ARGUMENTS</code>)
    </p><p>
      Message: Incorrect arguments to %s
    </p></li><li><p>
      Error: <code class="literal">1211</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_NO_PERMISSION_TO_CREATE_USER</code>)
    </p><p>
      Message: '%s'@'%s' is not allowed to create new users
    </p></li><li><p>
      Error: <code class="literal">1212</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_UNION_TABLES_IN_DIFFERENT_DIR</code>)
    </p><p>
      Message: Incorrect table definition; all MERGE tables must be in
      the same database
    </p></li><li><p>
      Error: <code class="literal">1213</code> SQLSTATE: <code class="literal">40001</code>
      (<code class="literal">ER_LOCK_DEADLOCK</code>)
    </p><p>
      Message: Deadlock found when trying to get lock; try restarting
      transaction
    </p></li><li><p>
      Error: <code class="literal">1214</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_TABLE_CANT_HANDLE_FT</code>)
    </p><p>
      Message: The used table type doesn't support FULLTEXT indexes
    </p></li><li><p>
      Error: <code class="literal">1215</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANNOT_ADD_FOREIGN</code>)
    </p><p>
      Message: Cannot add foreign key constraint
    </p></li><li><p>
      Error: <code class="literal">1216</code> SQLSTATE: <code class="literal">23000</code>
      (<code class="literal">ER_NO_REFERENCED_ROW</code>)
    </p><p>
      Message: Cannot add or update a child row: a foreign key
      constraint fails
    </p></li><li><p>
      Error: <code class="literal">1217</code> SQLSTATE: <code class="literal">23000</code>
      (<code class="literal">ER_ROW_IS_REFERENCED</code>)
    </p><p>
      Message: Cannot delete or update a parent row: a foreign key
      constraint fails
    </p></li><li><p>
      Error: <code class="literal">1218</code> SQLSTATE: <code class="literal">08S01</code>
      (<code class="literal">ER_CONNECT_TO_MASTER</code>)
    </p><p>
      Message: Error connecting to master: %s
    </p></li><li><p>
      Error: <code class="literal">1219</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_QUERY_ON_MASTER</code>)
    </p><p>
      Message: Error running query on master: %s
    </p></li><li><p>
      Error: <code class="literal">1220</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_ERROR_WHEN_EXECUTING_COMMAND</code>)
    </p><p>
      Message: Error when executing command %s: %s
    </p></li><li><p>
      Error: <code class="literal">1221</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_WRONG_USAGE</code>)
    </p><p>
      Message: Incorrect usage of %s and %s
    </p></li><li><p>
      Error: <code class="literal">1222</code> SQLSTATE: <code class="literal">21000</code>
      (<code class="literal">ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT</code>)
    </p><p>
      Message: The used SELECT statements have a different number of
      columns
    </p></li><li><p>
      Error: <code class="literal">1223</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANT_UPDATE_WITH_READLOCK</code>)
    </p><p>
      Message: Can't execute the query because you have a conflicting
      read lock
    </p></li><li><p>
      Error: <code class="literal">1224</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_MIXING_NOT_ALLOWED</code>)
    </p><p>
      Message: Mixing of transactional and non-transactional tables is
      disabled
    </p></li><li><p>
      Error: <code class="literal">1225</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_DUP_ARGUMENT</code>)
    </p><p>
      Message: Option '%s' used twice in statement
    </p></li><li><p>
      Error: <code class="literal">1226</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_USER_LIMIT_REACHED</code>)
    </p><p>
      Message: User '%s' has exceeded the '%s' resource (current value:
      %ld)
    </p></li><li><p>
      Error: <code class="literal">1227</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SPECIFIC_ACCESS_DENIED_ERROR</code>)
    </p><p>
      Message: Access denied; you need the %s privilege for this
      operation
    </p></li><li><p>
      Error: <code class="literal">1228</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_LOCAL_VARIABLE</code>)
    </p><p>
      Message: Variable '%s' is a SESSION variable and can't be used
      with SET GLOBAL
    </p></li><li><p>
      Error: <code class="literal">1229</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_GLOBAL_VARIABLE</code>)
    </p><p>
      Message: Variable '%s' is a GLOBAL variable and should be set with
      SET GLOBAL
    </p></li><li><p>
      Error: <code class="literal">1230</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_NO_DEFAULT</code>)
    </p><p>
      Message: Variable '%s' doesn't have a default value
    </p></li><li><p>
      Error: <code class="literal">1231</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_WRONG_VALUE_FOR_VAR</code>)
    </p><p>
      Message: Variable '%s' can't be set to the value of '%s'
    </p></li><li><p>
      Error: <code class="literal">1232</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_WRONG_TYPE_FOR_VAR</code>)
    </p><p>
      Message: Incorrect argument type to variable '%s'
    </p></li><li><p>
      Error: <code class="literal">1233</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_VAR_CANT_BE_READ</code>)
    </p><p>
      Message: Variable '%s' can only be set, not read
    </p></li><li><p>
      Error: <code class="literal">1234</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_CANT_USE_OPTION_HERE</code>)
    </p><p>
      Message: Incorrect usage/placement of '%s'
    </p></li><li><p>
      Error: <code class="literal">1235</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_NOT_SUPPORTED_YET</code>)
    </p><p>
      Message: This version of MySQL doesn't yet support '%s'
    </p></li><li><p>
      Error: <code class="literal">1236</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_MASTER_FATAL_ERROR_READING_BINLOG</code>)
    </p><p>
      Message: Got fatal error %d: '%s' from master when reading data
      from binary log
    </p></li><li><p>
      Error: <code class="literal">1237</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_SLAVE_IGNORED_TABLE</code>)
    </p><p>
      Message: Slave SQL thread ignored the query because of
      replicate-*-table rules
    </p></li><li><p>
      Error: <code class="literal">1238</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_INCORRECT_GLOBAL_LOCAL_VAR</code>)
    </p><p>
      Message: Variable '%s' is a %s variable
    </p></li><li><p>
      Error: <code class="literal">1239</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_WRONG_FK_DEF</code>)
    </p><p>
      Message: Incorrect foreign key definition for '%s': %s
    </p></li><li><p>
      Error: <code class="literal">1240</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_KEY_REF_DO_NOT_MATCH_TABLE_REF</code>)
    </p><p>
      Message: Key reference and table reference don't match
    </p></li><li><p>
      Error: <code class="literal">1241</code> SQLSTATE: <code class="literal">21000</code>
      (<code class="literal">ER_OPERAND_COLUMNS</code>)
    </p><p>
      Message: Operand should contain %d column(s)
    </p></li><li><p>
      Error: <code class="literal">1242</code> SQLSTATE: <code class="literal">21000</code>
      (<code class="literal">ER_SUBQUERY_NO_1_ROW</code>)
    </p><p>
      Message: Subquery returns more than 1 row
    </p></li><li><p>
      Error: <code class="literal">1243</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_UNKNOWN_STMT_HANDLER</code>)
    </p><p>
      Message: Unknown prepared statement handler (%.*s) given to %s
    </p></li><li><p>
      Error: <code class="literal">1244</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CORRUPT_HELP_DB</code>)
    </p><p>
      Message: Help database is corrupt or does not exist
    </p></li><li><p>
      Error: <code class="literal">1245</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CYCLIC_REFERENCE</code>)
    </p><p>
      Message: Cyclic reference on subqueries
    </p></li><li><p>
      Error: <code class="literal">1246</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_AUTO_CONVERT</code>)
    </p><p>
      Message: Converting column '%s' from %s to %s
    </p></li><li><p>
      Error: <code class="literal">1247</code> SQLSTATE: <code class="literal">42S22</code>
      (<code class="literal">ER_ILLEGAL_REFERENCE</code>)
    </p><p>
      Message: Reference '%s' not supported (%s)
    </p></li><li><p>
      Error: <code class="literal">1248</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_DERIVED_MUST_HAVE_ALIAS</code>)
    </p><p>
      Message: Every derived table must have its own alias
    </p></li><li><p>
      Error: <code class="literal">1249</code> SQLSTATE: <code class="literal">01000</code>
      (<code class="literal">ER_SELECT_REDUCED</code>)
    </p><p>
      Message: Select %u was reduced during optimization
    </p></li><li><p>
      Error: <code class="literal">1250</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_TABLENAME_NOT_ALLOWED_HERE</code>)
    </p><p>
      Message: Table '%s' from one of the SELECTs cannot be used in %s
    </p></li><li><p>
      Error: <code class="literal">1251</code> SQLSTATE: <code class="literal">08004</code>
      (<code class="literal">ER_NOT_SUPPORTED_AUTH_MODE</code>)
    </p><p>
      Message: Client does not support authentication protocol requested
      by server; consider upgrading MySQL client
    </p></li><li><p>
      Error: <code class="literal">1252</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SPATIAL_CANT_HAVE_NULL</code>)
    </p><p>
      Message: All parts of a SPATIAL index must be NOT NULL
    </p></li><li><p>
      Error: <code class="literal">1253</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_COLLATION_CHARSET_MISMATCH</code>)
    </p><p>
      Message: COLLATION '%s' is not valid for CHARACTER SET '%s'
    </p></li><li><p>
      Error: <code class="literal">1254</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_SLAVE_WAS_RUNNING</code>)
    </p><p>
      Message: Slave is already running
    </p></li><li><p>
      Error: <code class="literal">1255</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_SLAVE_WAS_NOT_RUNNING</code>)
    </p><p>
      Message: Slave already has been stopped
    </p></li><li><p>
      Error: <code class="literal">1256</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_TOO_BIG_FOR_UNCOMPRESS</code>)
    </p><p>
      Message: Uncompressed data size too large; the maximum size is %d
      (probably, length of uncompressed data was corrupted)
    </p></li><li><p>
      Error: <code class="literal">1257</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_ZLIB_Z_MEM_ERROR</code>)
    </p><p>
      Message: ZLIB: Not enough memory
    </p></li><li><p>
      Error: <code class="literal">1258</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_ZLIB_Z_BUF_ERROR</code>)
    </p><p>
      Message: ZLIB: Not enough room in the output buffer (probably,
      length of uncompressed data was corrupted)
    </p></li><li><p>
      Error: <code class="literal">1259</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_ZLIB_Z_DATA_ERROR</code>)
    </p><p>
      Message: ZLIB: Input data corrupted
    </p></li><li><p>
      Error: <code class="literal">1260</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CUT_VALUE_GROUP_CONCAT</code>)
    </p><p>
      Message: %d line(s) were cut by GROUP_CONCAT()
    </p></li><li><p>
      Error: <code class="literal">1261</code> SQLSTATE: <code class="literal">01000</code>
      (<code class="literal">ER_WARN_TOO_FEW_RECORDS</code>)
    </p><p>
      Message: Row %ld doesn't contain data for all columns
    </p></li><li><p>
      Error: <code class="literal">1262</code> SQLSTATE: <code class="literal">01000</code>
      (<code class="literal">ER_WARN_TOO_MANY_RECORDS</code>)
    </p><p>
      Message: Row %ld was truncated; it contained more data than there
      were input columns
    </p></li><li><p>
      Error: <code class="literal">1263</code> SQLSTATE: <code class="literal">22004</code>
      (<code class="literal">ER_WARN_NULL_TO_NOTNULL</code>)
    </p><p>
      Message: Column was set to data type implicit default; NULL
      supplied for NOT NULL column '%s' at row %ld
    </p></li><li><p>
      Error: <code class="literal">1264</code> SQLSTATE: <code class="literal">22003</code>
      (<code class="literal">ER_WARN_DATA_OUT_OF_RANGE</code>)
    </p><p>
      Message: Out of range value adjusted for column '%s' at row %ld
    </p></li><li><p>
      Error: <code class="literal">1265</code> SQLSTATE: <code class="literal">01000</code>
      (<code class="literal">WARN_DATA_TRUNCATED</code>)
    </p><p>
      Message: Data truncated for column '%s' at row %ld
    </p></li><li><p>
      Error: <code class="literal">1266</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_WARN_USING_OTHER_HANDLER</code>)
    </p><p>
      Message: Using storage engine %s for table '%s'
    </p></li><li><p>
      Error: <code class="literal">1267</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANT_AGGREGATE_2COLLATIONS</code>)
    </p><p>
      Message: Illegal mix of collations (%s,%s) and (%s,%s) for
      operation '%s'
    </p></li><li><p>
      Error: <code class="literal">1268</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_DROP_USER</code>)
    </p><p>
      Message: Cannot drop one or more of the requested users
    </p></li><li><p>
      Error: <code class="literal">1269</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_REVOKE_GRANTS</code>)
    </p><p>
      Message: Can't revoke all privileges for one or more of the
      requested users
    </p></li><li><p>
      Error: <code class="literal">1270</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANT_AGGREGATE_3COLLATIONS</code>)
    </p><p>
      Message: Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for
      operation '%s'
    </p></li><li><p>
      Error: <code class="literal">1271</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANT_AGGREGATE_NCOLLATIONS</code>)
    </p><p>
      Message: Illegal mix of collations for operation '%s'
    </p></li><li><p>
      Error: <code class="literal">1272</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_VARIABLE_IS_NOT_STRUCT</code>)
    </p><p>
      Message: Variable '%s' is not a variable component (can't be used
      as XXXX.variable_name)
    </p></li><li><p>
      Error: <code class="literal">1273</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_UNKNOWN_COLLATION</code>)
    </p><p>
      Message: Unknown collation: '%s'
    </p></li><li><p>
      Error: <code class="literal">1274</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_SLAVE_IGNORED_SSL_PARAMS</code>)
    </p><p>
      Message: SSL parameters in CHANGE MASTER are ignored because this
      MySQL slave was compiled without SSL support; they can be used
      later if MySQL slave with SSL is started
    </p></li><li><p>
      Error: <code class="literal">1275</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_SERVER_IS_IN_SECURE_AUTH_MODE</code>)
    </p><p>
      Message: Server is running in --secure-auth mode, but '%s'@'%s'
      has a password in the old format; please change the password to
      the new format
    </p></li><li><p>
      Error: <code class="literal">1276</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_WARN_FIELD_RESOLVED</code>)
    </p><p>
      Message: Field or reference '%s%s%s%s%s' of SELECT #%d was
      resolved in SELECT #%d
    </p></li><li><p>
      Error: <code class="literal">1277</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_BAD_SLAVE_UNTIL_COND</code>)
    </p><p>
      Message: Incorrect parameter or combination of parameters for
      START SLAVE UNTIL
    </p></li><li><p>
      Error: <code class="literal">1278</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_MISSING_SKIP_SLAVE</code>)
    </p><p>
      Message: It is recommended to use --skip-slave-start when doing
      step-by-step replication with START SLAVE UNTIL; otherwise, you
      will get problems if you get an unexpected slave's mysqld restart
    </p></li><li><p>
      Error: <code class="literal">1279</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_UNTIL_COND_IGNORED</code>)
    </p><p>
      Message: SQL thread is not to be started so UNTIL options are
      ignored
    </p></li><li><p>
      Error: <code class="literal">1280</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_WRONG_NAME_FOR_INDEX</code>)
    </p><p>
      Message: Incorrect index name '%s'
    </p></li><li><p>
      Error: <code class="literal">1281</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_WRONG_NAME_FOR_CATALOG</code>)
    </p><p>
      Message: Incorrect catalog name '%s'
    </p></li><li><p>
      Error: <code class="literal">1282</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_WARN_QC_RESIZE</code>)
    </p><p>
      Message: Query cache failed to set size %lu; new query cache size
      is %lu
    </p></li><li><p>
      Error: <code class="literal">1283</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_BAD_FT_COLUMN</code>)
    </p><p>
      Message: Column '%s' cannot be part of FULLTEXT index
    </p></li><li><p>
      Error: <code class="literal">1284</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_UNKNOWN_KEY_CACHE</code>)
    </p><p>
      Message: Unknown key cache '%s'
    </p></li><li><p>
      Error: <code class="literal">1285</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_WARN_HOSTNAME_WONT_WORK</code>)
    </p><p>
      Message: MySQL is started in --skip-name-resolve mode; you must
      restart it without this switch for this grant to work
    </p></li><li><p>
      Error: <code class="literal">1286</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_UNKNOWN_STORAGE_ENGINE</code>)
    </p><p>
      Message: Unknown table engine '%s'
    </p></li><li><p>
      Error: <code class="literal">1287</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_WARN_DEPRECATED_SYNTAX</code>)
    </p><p>
      Message: '%s' is deprecated; use '%s' instead
    </p></li><li><p>
      Error: <code class="literal">1288</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_NON_UPDATABLE_TABLE</code>)
    </p><p>
      Message: The target table %s of the %s is not updatable
    </p></li><li><p>
      Error: <code class="literal">1289</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_FEATURE_DISABLED</code>)
    </p><p>
      Message: The '%s' feature is disabled; you need MySQL built with
      '%s' to have it working
    </p></li><li><p>
      Error: <code class="literal">1290</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_OPTION_PREVENTS_STATEMENT</code>)
    </p><p>
      Message: The MySQL server is running with the %s option so it
      cannot execute this statement
    </p></li><li><p>
      Error: <code class="literal">1291</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_DUPLICATED_VALUE_IN_TYPE</code>)
    </p><p>
      Message: Column '%s' has duplicated value '%s' in %s
    </p></li><li><p>
      Error: <code class="literal">1292</code> SQLSTATE: <code class="literal">22007</code>
      (<code class="literal">ER_TRUNCATED_WRONG_VALUE</code>)
    </p><p>
      Message: Truncated incorrect %s value: '%s'
    </p></li><li><p>
      Error: <code class="literal">1293</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_TOO_MUCH_AUTO_TIMESTAMP_COLS</code>)
    </p><p>
      Message: Incorrect table definition; there can be only one
      TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE
      clause
    </p></li><li><p>
      Error: <code class="literal">1294</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_INVALID_ON_UPDATE</code>)
    </p><p>
      Message: Invalid ON UPDATE clause for '%s' column
    </p></li><li><p>
      Error: <code class="literal">1295</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_UNSUPPORTED_PS</code>)
    </p><p>
      Message: This command is not supported in the prepared statement
      protocol yet
    </p></li><li><p>
      Error: <code class="literal">1296</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_GET_ERRMSG</code>)
    </p><p>
      Message: Got error %d '%s' from %s
    </p></li><li><p>
      Error: <code class="literal">1297</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_GET_TEMPORARY_ERRMSG</code>)
    </p><p>
      Message: Got temporary error %d '%s' from %s
    </p></li><li><p>
      Error: <code class="literal">1298</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_UNKNOWN_TIME_ZONE</code>)
    </p><p>
      Message: Unknown or incorrect time zone: '%s'
    </p></li><li><p>
      Error: <code class="literal">1299</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_WARN_INVALID_TIMESTAMP</code>)
    </p><p>
      Message: Invalid TIMESTAMP value in column '%s' at row %ld
    </p></li><li><p>
      Error: <code class="literal">1300</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_INVALID_CHARACTER_STRING</code>)
    </p><p>
      Message: Invalid %s character string: '%s'
    </p></li><li><p>
      Error: <code class="literal">1301</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_WARN_ALLOWED_PACKET_OVERFLOWED</code>)
    </p><p>
      Message: Result of %s() was larger than max_allowed_packet (%ld) -
      truncated
    </p></li><li><p>
      Error: <code class="literal">1302</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CONFLICTING_DECLARATIONS</code>)
    </p><p>
      Message: Conflicting declarations: '%s%s' and '%s%s'
    </p></li><li><p>
      Error: <code class="literal">1303</code> SQLSTATE: <code class="literal">2F003</code>
      (<code class="literal">ER_SP_NO_RECURSIVE_CREATE</code>)
    </p><p>
      Message: Can't create a %s from within another stored routine
    </p></li><li><p>
      Error: <code class="literal">1304</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_ALREADY_EXISTS</code>)
    </p><p>
      Message: %s %s already exists
    </p></li><li><p>
      Error: <code class="literal">1305</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_DOES_NOT_EXIST</code>)
    </p><p>
      Message: %s %s does not exist
    </p></li><li><p>
      Error: <code class="literal">1306</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_SP_DROP_FAILED</code>)
    </p><p>
      Message: Failed to DROP %s %s
    </p></li><li><p>
      Error: <code class="literal">1307</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_SP_STORE_FAILED</code>)
    </p><p>
      Message: Failed to CREATE %s %s
    </p></li><li><p>
      Error: <code class="literal">1308</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_LILABEL_MISMATCH</code>)
    </p><p>
      Message: %s with no matching label: %s
    </p></li><li><p>
      Error: <code class="literal">1309</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_LABEL_REDEFINE</code>)
    </p><p>
      Message: Redefining label %s
    </p></li><li><p>
      Error: <code class="literal">1310</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_LABEL_MISMATCH</code>)
    </p><p>
      Message: End-label %s without match
    </p></li><li><p>
      Error: <code class="literal">1311</code> SQLSTATE: <code class="literal">01000</code>
      (<code class="literal">ER_SP_UNINIT_VAR</code>)
    </p><p>
      Message: Referring to uninitialized variable %s
    </p></li><li><p>
      Error: <code class="literal">1312</code> SQLSTATE: <code class="literal">0A000</code>
      (<code class="literal">ER_SP_BADSELECT</code>)
    </p><p>
      Message: PROCEDURE %s can't return a result set in the given
      context
    </p></li><li><p>
      Error: <code class="literal">1313</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_BADRETURN</code>)
    </p><p>
      Message: RETURN is only allowed in a FUNCTION
    </p></li><li><p>
      Error: <code class="literal">1314</code> SQLSTATE: <code class="literal">0A000</code>
      (<code class="literal">ER_SP_BADSTATEMENT</code>)
    </p><p>
      Message: %s is not allowed in stored procedures
    </p></li><li><p>
      Error: <code class="literal">1315</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_UPDATE_LOG_DEPRECATED_IGNORED</code>)
    </p><p>
      Message: The update log is deprecated and replaced by the binary
      log; SET SQL_LOG_UPDATE has been ignored
    </p></li><li><p>
      Error: <code class="literal">1316</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_UPDATE_LOG_DEPRECATED_TRANSLATED</code>)
    </p><p>
      Message: The update log is deprecated and replaced by the binary
      log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN
    </p></li><li><p>
      Error: <code class="literal">1317</code> SQLSTATE: <code class="literal">70100</code>
      (<code class="literal">ER_QUERY_INTERRUPTED</code>)
    </p><p>
      Message: Query execution was interrupted
    </p></li><li><p>
      Error: <code class="literal">1318</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_WRONG_NO_OF_ARGS</code>)
    </p><p>
      Message: Incorrect number of arguments for %s %s; expected %u, got
      %u
    </p></li><li><p>
      Error: <code class="literal">1319</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_COND_MISMATCH</code>)
    </p><p>
      Message: Undefined CONDITION: %s
    </p></li><li><p>
      Error: <code class="literal">1320</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_NORETURN</code>)
    </p><p>
      Message: No RETURN found in FUNCTION %s
    </p></li><li><p>
      Error: <code class="literal">1321</code> SQLSTATE: <code class="literal">2F005</code>
      (<code class="literal">ER_SP_NORETURNEND</code>)
    </p><p>
      Message: FUNCTION %s ended without RETURN
    </p></li><li><p>
      Error: <code class="literal">1322</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_BAD_CURSOR_QUERY</code>)
    </p><p>
      Message: Cursor statement must be a SELECT
    </p></li><li><p>
      Error: <code class="literal">1323</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_BAD_CURSOR_SELECT</code>)
    </p><p>
      Message: Cursor SELECT must not have INTO
    </p></li><li><p>
      Error: <code class="literal">1324</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_CURSOR_MISMATCH</code>)
    </p><p>
      Message: Undefined CURSOR: %s
    </p></li><li><p>
      Error: <code class="literal">1325</code> SQLSTATE: <code class="literal">24000</code>
      (<code class="literal">ER_SP_CURSOR_ALREADY_OPEN</code>)
    </p><p>
      Message: Cursor is already open
    </p></li><li><p>
      Error: <code class="literal">1326</code> SQLSTATE: <code class="literal">24000</code>
      (<code class="literal">ER_SP_CURSOR_NOT_OPEN</code>)
    </p><p>
      Message: Cursor is not open
    </p></li><li><p>
      Error: <code class="literal">1327</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_UNDECLARED_VAR</code>)
    </p><p>
      Message: Undeclared variable: %s
    </p></li><li><p>
      Error: <code class="literal">1328</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_SP_WRONG_NO_OF_FETCH_ARGS</code>)
    </p><p>
      Message: Incorrect number of FETCH variables
    </p></li><li><p>
      Error: <code class="literal">1329</code> SQLSTATE: <code class="literal">02000</code>
      (<code class="literal">ER_SP_FETCH_NO_DATA</code>)
    </p><p>
      Message: No data - zero rows fetched, selected, or processed
    </p></li><li><p>
      Error: <code class="literal">1330</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_DUP_PARAM</code>)
    </p><p>
      Message: Duplicate parameter: %s
    </p></li><li><p>
      Error: <code class="literal">1331</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_DUP_VAR</code>)
    </p><p>
      Message: Duplicate variable: %s
    </p></li><li><p>
      Error: <code class="literal">1332</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_DUP_COND</code>)
    </p><p>
      Message: Duplicate condition: %s
    </p></li><li><p>
      Error: <code class="literal">1333</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_DUP_CURS</code>)
    </p><p>
      Message: Duplicate cursor: %s
    </p></li><li><p>
      Error: <code class="literal">1334</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_SP_CANT_ALTER</code>)
    </p><p>
      Message: Failed to ALTER %s %s
    </p></li><li><p>
      Error: <code class="literal">1335</code> SQLSTATE: <code class="literal">0A000</code>
      (<code class="literal">ER_SP_SUBSELECT_NYI</code>)
    </p><p>
      Message: Subselect value not supported
    </p></li><li><p>
      Error: <code class="literal">1336</code> SQLSTATE: <code class="literal">0A000</code>
      (<code class="literal">ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG</code>)
    </p><p>
      Message: %s is not allowed in stored function or trigger
    </p></li><li><p>
      Error: <code class="literal">1337</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_VARCOND_AFTER_CURSHNDLR</code>)
    </p><p>
      Message: Variable or condition declaration after cursor or handler
      declaration
    </p></li><li><p>
      Error: <code class="literal">1338</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_CURSOR_AFTER_HANDLER</code>)
    </p><p>
      Message: Cursor declaration after handler declaration
    </p></li><li><p>
      Error: <code class="literal">1339</code> SQLSTATE: <code class="literal">20000</code>
      (<code class="literal">ER_SP_CASE_NOT_FOUND</code>)
    </p><p>
      Message: Case not found for CASE statement
    </p></li><li><p>
      Error: <code class="literal">1340</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_FPARSER_TOO_BIG_FILE</code>)
    </p><p>
      Message: Configuration file '%s' is too big
    </p></li><li><p>
      Error: <code class="literal">1341</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_FPARSER_BAD_HEADER</code>)
    </p><p>
      Message: Malformed file type header in file '%s'
    </p></li><li><p>
      Error: <code class="literal">1342</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_FPARSER_EOF_IN_COMMENT</code>)
    </p><p>
      Message: Unexpected end of file while parsing comment '%s'
    </p></li><li><p>
      Error: <code class="literal">1343</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_FPARSER_ERROR_IN_PARAMETER</code>)
    </p><p>
      Message: Error while parsing parameter '%s' (line: '%s')
    </p></li><li><p>
      Error: <code class="literal">1344</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER</code>)
    </p><p>
      Message: Unexpected end of file while skipping unknown parameter
      '%s'
    </p></li><li><p>
      Error: <code class="literal">1345</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_VIEW_NO_EXPLAIN</code>)
    </p><p>
      Message: EXPLAIN/SHOW can not be issued; lacking privileges for
      underlying table
    </p></li><li><p>
      Error: <code class="literal">1346</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_FRM_UNKNOWN_TYPE</code>)
    </p><p>
      Message: File '%s' has unknown type '%s' in its header
    </p></li><li><p>
      Error: <code class="literal">1347</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_WRONG_OBJECT</code>)
    </p><p>
      Message: '%s.%s' is not %s
    </p></li><li><p>
      Error: <code class="literal">1348</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_NONUPDATEABLE_COLUMN</code>)
    </p><p>
      Message: Column '%s' is not updatable
    </p></li><li><p>
      Error: <code class="literal">1349</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_VIEW_SELECT_DERIVED</code>)
    </p><p>
      Message: View's SELECT contains a subquery in the FROM clause
    </p></li><li><p>
      Error: <code class="literal">1350</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_VIEW_SELECT_CLAUSE</code>)
    </p><p>
      Message: View's SELECT contains a '%s' clause
    </p></li><li><p>
      Error: <code class="literal">1351</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_VIEW_SELECT_VARIABLE</code>)
    </p><p>
      Message: View's SELECT contains a variable or parameter
    </p></li><li><p>
      Error: <code class="literal">1352</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_VIEW_SELECT_TMPTABLE</code>)
    </p><p>
      Message: View's SELECT refers to a temporary table '%s'
    </p></li><li><p>
      Error: <code class="literal">1353</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_VIEW_WRONG_LIST</code>)
    </p><p>
      Message: View's SELECT and view's field list have different column
      counts
    </p></li><li><p>
      Error: <code class="literal">1354</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_WARN_VIEW_MERGE</code>)
    </p><p>
      Message: View merge algorithm can't be used here for now (assumed
      undefined algorithm)
    </p></li><li><p>
      Error: <code class="literal">1355</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_WARN_VIEW_WITHOUT_KEY</code>)
    </p><p>
      Message: View being updated does not have complete key of
      underlying table in it
    </p></li><li><p>
      Error: <code class="literal">1356</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_VIEW_INVALID</code>)
    </p><p>
      Message: View '%s.%s' references invalid table(s) or column(s) or
      function(s) or definer/invoker of view lack rights to use them
    </p></li><li><p>
      Error: <code class="literal">1357</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_SP_NO_DROP_SP</code>)
    </p><p>
      Message: Can't drop or alter a %s from within another stored
      routine
    </p></li><li><p>
      Error: <code class="literal">1358</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_SP_GOTO_IN_HNDLR</code>)
    </p><p>
      Message: GOTO is not allowed in a stored procedure handler
    </p></li><li><p>
      Error: <code class="literal">1359</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_TRG_ALREADY_EXISTS</code>)
    </p><p>
      Message: Trigger already exists
    </p></li><li><p>
      Error: <code class="literal">1360</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_TRG_DOES_NOT_EXIST</code>)
    </p><p>
      Message: Trigger does not exist
    </p></li><li><p>
      Error: <code class="literal">1361</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_TRG_ON_VIEW_OR_TEMP_TABLE</code>)
    </p><p>
      Message: Trigger's '%s' is view or temporary table
    </p></li><li><p>
      Error: <code class="literal">1362</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_TRG_CANT_CHANGE_ROW</code>)
    </p><p>
      Message: Updating of %s row is not allowed in %strigger
    </p></li><li><p>
      Error: <code class="literal">1363</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_TRG_NO_SUCH_ROW_IN_TRG</code>)
    </p><p>
      Message: There is no %s row in %s trigger
    </p></li><li><p>
      Error: <code class="literal">1364</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_NO_DEFAULT_FOR_FIELD</code>)
    </p><p>
      Message: Field '%s' doesn't have a default value
    </p></li><li><p>
      Error: <code class="literal">1365</code> SQLSTATE: <code class="literal">22012</code>
      (<code class="literal">ER_DIVISION_BY_ZERO</code>)
    </p><p>
      Message: Division by 0
    </p></li><li><p>
      Error: <code class="literal">1366</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_TRUNCATED_WRONG_VALUE_FOR_FIELD</code>)
    </p><p>
      Message: Incorrect %s value: '%s' for column '%s' at row %ld
    </p></li><li><p>
      Error: <code class="literal">1367</code> SQLSTATE: <code class="literal">22007</code>
      (<code class="literal">ER_ILLEGAL_VALUE_FOR_TYPE</code>)
    </p><p>
      Message: Illegal %s '%s' value found during parsing
    </p></li><li><p>
      Error: <code class="literal">1368</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_VIEW_NONUPD_CHECK</code>)
    </p><p>
      Message: CHECK OPTION on non-updatable view '%s.%s'
    </p></li><li><p>
      Error: <code class="literal">1369</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_VIEW_CHECK_FAILED</code>)
    </p><p>
      Message: CHECK OPTION failed '%s.%s'
    </p></li><li><p>
      Error: <code class="literal">1370</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_PROCACCESS_DENIED_ERROR</code>)
    </p><p>
      Message: %s command denied to user '%s'@'%s' for routine '%s'
    </p></li><li><p>
      Error: <code class="literal">1371</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_RELAY_LOG_FAIL</code>)
    </p><p>
      Message: Failed purging old relay logs: %s
    </p></li><li><p>
      Error: <code class="literal">1372</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_PASSWD_LENGTH</code>)
    </p><p>
      Message: Password hash should be a %d-digit hexadecimal number
    </p></li><li><p>
      Error: <code class="literal">1373</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_UNKNOWN_TARGET_BINLOG</code>)
    </p><p>
      Message: Target log not found in binlog index
    </p></li><li><p>
      Error: <code class="literal">1374</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_IO_ERR_LOG_INDEX_READ</code>)
    </p><p>
      Message: I/O error reading log index file
    </p></li><li><p>
      Error: <code class="literal">1375</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_BINLOG_PURGE_PROHIBITED</code>)
    </p><p>
      Message: Server configuration does not permit binlog purge
    </p></li><li><p>
      Error: <code class="literal">1376</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_FSEEK_FAIL</code>)
    </p><p>
      Message: Failed on fseek()
    </p></li><li><p>
      Error: <code class="literal">1377</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_BINLOG_PURGE_FATAL_ERR</code>)
    </p><p>
      Message: Fatal error during log purge
    </p></li><li><p>
      Error: <code class="literal">1378</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_LOG_IN_USE</code>)
    </p><p>
      Message: A purgeable log is in use, will not purge
    </p></li><li><p>
      Error: <code class="literal">1379</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_LOG_PURGE_UNKNOWN_ERR</code>)
    </p><p>
      Message: Unknown error during log purge
    </p></li><li><p>
      Error: <code class="literal">1380</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_RELAY_LOG_INIT</code>)
    </p><p>
      Message: Failed initializing relay log position: %s
    </p></li><li><p>
      Error: <code class="literal">1381</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_NO_BINARY_LOGGING</code>)
    </p><p>
      Message: You are not using binary logging
    </p></li><li><p>
      Error: <code class="literal">1382</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_RESERVED_SYNTAX</code>)
    </p><p>
      Message: The '%s' syntax is reserved for purposes internal to the
      MySQL server
    </p></li><li><p>
      Error: <code class="literal">1383</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_WSAS_FAILED</code>)
    </p><p>
      Message: WSAStartup Failed
    </p></li><li><p>
      Error: <code class="literal">1384</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_DIFF_GROUPS_PROC</code>)
    </p><p>
      Message: Can't handle procedures with different groups yet
    </p></li><li><p>
      Error: <code class="literal">1385</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_NO_GROUP_FOR_PROC</code>)
    </p><p>
      Message: Select must have a group with this procedure
    </p></li><li><p>
      Error: <code class="literal">1386</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_ORDER_WITH_PROC</code>)
    </p><p>
      Message: Can't use ORDER clause with this procedure
    </p></li><li><p>
      Error: <code class="literal">1387</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_LOGGING_PROHIBIT_CHANGING_OF</code>)
    </p><p>
      Message: Binary logging and replication forbid changing the global
      server %s
    </p></li><li><p>
      Error: <code class="literal">1388</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_NO_FILE_MAPPING</code>)
    </p><p>
      Message: Can't map file: %s, errno: %d
    </p></li><li><p>
      Error: <code class="literal">1389</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_WRONG_MAGIC</code>)
    </p><p>
      Message: Wrong magic in %s
    </p></li><li><p>
      Error: <code class="literal">1390</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_PS_MANY_PARAM</code>)
    </p><p>
      Message: Prepared statement contains too many placeholders
    </p></li><li><p>
      Error: <code class="literal">1391</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_KEY_PART_0</code>)
    </p><p>
      Message: Key part '%s' length cannot be 0
    </p></li><li><p>
      Error: <code class="literal">1392</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_VIEW_CHECKSUM</code>)
    </p><p>
      Message: View text checksum failed
    </p></li><li><p>
      Error: <code class="literal">1393</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_VIEW_MULTIUPDATE</code>)
    </p><p>
      Message: Can not modify more than one base table through a join
      view '%s.%s'
    </p></li><li><p>
      Error: <code class="literal">1394</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_VIEW_NO_INSERT_FIELD_LIST</code>)
    </p><p>
      Message: Can not insert into join view '%s.%s' without fields list
    </p></li><li><p>
      Error: <code class="literal">1395</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_VIEW_DELETE_MERGE_VIEW</code>)
    </p><p>
      Message: Can not delete from join view '%s.%s'
    </p></li><li><p>
      Error: <code class="literal">1396</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANNOT_USER</code>)
    </p><p>
      Message: Operation %s failed for %s
    </p></li><li><p>
      Error: <code class="literal">1397</code> SQLSTATE: <code class="literal">XAE04</code>
      (<code class="literal">ER_XAER_NOTA</code>)
    </p><p>
      Message: XAER_NOTA: Unknown XID
    </p></li><li><p>
      Error: <code class="literal">1398</code> SQLSTATE: <code class="literal">XAE05</code>
      (<code class="literal">ER_XAER_INVAL</code>)
    </p><p>
      Message: XAER_INVAL: Invalid arguments (or unsupported command)
    </p></li><li><p>
      Error: <code class="literal">1399</code> SQLSTATE: <code class="literal">XAE07</code>
      (<code class="literal">ER_XAER_RMFAIL</code>)
    </p><p>
      Message: XAER_RMFAIL: The command cannot be executed when global
      transaction is in the %s state
    </p></li><li><p>
      Error: <code class="literal">1400</code> SQLSTATE: <code class="literal">XAE09</code>
      (<code class="literal">ER_XAER_OUTSIDE</code>)
    </p><p>
      Message: XAER_OUTSIDE: Some work is done outside global
      transaction
    </p></li><li><p>
      Error: <code class="literal">1401</code> SQLSTATE: <code class="literal">XAE03</code>
      (<code class="literal">ER_XAER_RMERR</code>)
    </p><p>
      Message: XAER_RMERR: Fatal error occurred in the transaction
      branch - check your data for consistency
    </p></li><li><p>
      Error: <code class="literal">1402</code> SQLSTATE: <code class="literal">XA100</code>
      (<code class="literal">ER_XA_RBROLLBACK</code>)
    </p><p>
      Message: XA_RBROLLBACK: Transaction branch was rolled back
    </p></li><li><p>
      Error: <code class="literal">1403</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_NONEXISTING_PROC_GRANT</code>)
    </p><p>
      Message: There is no such grant defined for user '%s' on host '%s'
      on routine '%s'
    </p></li><li><p>
      Error: <code class="literal">1404</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_PROC_AUTO_GRANT_FAIL</code>)
    </p><p>
      Message: Failed to grant EXECUTE and ALTER ROUTINE privileges
    </p></li><li><p>
      Error: <code class="literal">1405</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_PROC_AUTO_REVOKE_FAIL</code>)
    </p><p>
      Message: Failed to revoke all privileges to dropped routine
    </p></li><li><p>
      Error: <code class="literal">1406</code> SQLSTATE: <code class="literal">22001</code>
      (<code class="literal">ER_DATA_TOO_LONG</code>)
    </p><p>
      Message: Data too long for column '%s' at row %ld
    </p></li><li><p>
      Error: <code class="literal">1407</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_BAD_SQLSTATE</code>)
    </p><p>
      Message: Bad SQLSTATE: '%s'
    </p></li><li><p>
      Error: <code class="literal">1408</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_STARTUP</code>)
    </p><p>
      Message: %s: ready for connections. Version: '%s' socket: '%s'
      port: %d %s
    </p></li><li><p>
      Error: <code class="literal">1409</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR</code>)
    </p><p>
      Message: Can't load value from file with fixed size rows to
      variable
    </p></li><li><p>
      Error: <code class="literal">1410</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_CANT_CREATE_USER_WITH_GRANT</code>)
    </p><p>
      Message: You are not allowed to create a user with GRANT
    </p></li><li><p>
      Error: <code class="literal">1411</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_WRONG_VALUE_FOR_TYPE</code>)
    </p><p>
      Message: Incorrect %s value: '%s' for function %s
    </p></li><li><p>
      Error: <code class="literal">1412</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_TABLE_DEF_CHANGED</code>)
    </p><p>
      Message: Table definition has changed, please retry transaction
    </p></li><li><p>
      Error: <code class="literal">1413</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_DUP_HANDLER</code>)
    </p><p>
      Message: Duplicate handler declared in the same block
    </p></li><li><p>
      Error: <code class="literal">1414</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_NOT_VAR_ARG</code>)
    </p><p>
      Message: OUT or INOUT argument %d for routine %s is not a variable
      or NEW pseudo-variable in BEFORE trigger
    </p></li><li><p>
      Error: <code class="literal">1415</code> SQLSTATE: <code class="literal">0A000</code>
      (<code class="literal">ER_SP_NO_RETSET</code>)
    </p><p>
      Message: Not allowed to return a result set from a %s
    </p></li><li><p>
      Error: <code class="literal">1416</code> SQLSTATE: <code class="literal">22003</code>
      (<code class="literal">ER_CANT_CREATE_GEOMETRY_OBJECT</code>)
    </p><p>
      Message: Cannot get geometry object from data you send to the
      GEOMETRY field
    </p></li><li><p>
      Error: <code class="literal">1417</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_FAILED_ROUTINE_BREAK_BINLOG</code>)
    </p><p>
      Message: A routine failed and has neither NO SQL nor READS SQL
      DATA in its declaration and binary logging is enabled; if
      non-transactional tables were updated, the binary log will miss
      their changes
    </p></li><li><p>
      Error: <code class="literal">1418</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_BINLOG_UNSAFE_ROUTINE</code>)
    </p><p>
      Message: This function has none of DETERMINISTIC, NO SQL, or READS
      SQL DATA in its declaration and binary logging is enabled (you
      *might* want to use the less safe log_bin_trust_function_creators
      variable)
    </p></li><li><p>
      Error: <code class="literal">1419</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_BINLOG_CREATE_ROUTINE_NEED_SUPER</code>)
    </p><p>
      Message: You do not have the SUPER privilege and binary logging is
      enabled (you *might* want to use the less safe
      log_bin_trust_function_creators variable)
    </p></li><li><p>
      Error: <code class="literal">1420</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_EXEC_STMT_WITH_OPEN_CURSOR</code>)
    </p><p>
      Message: You can't execute a prepared statement which has an open
      cursor associated with it. Reset the statement to re-execute it.
    </p></li><li><p>
      Error: <code class="literal">1421</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_STMT_HAS_NO_OPEN_CURSOR</code>)
    </p><p>
      Message: The statement (%lu) has no open cursor.
    </p></li><li><p>
      Error: <code class="literal">1422</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG</code>)
    </p><p>
      Message: Explicit or implicit commit is not allowed in stored
      function or trigger.
    </p></li><li><p>
      Error: <code class="literal">1423</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_NO_DEFAULT_FOR_VIEW_FIELD</code>)
    </p><p>
      Message: Field of view '%s.%s' underlying table doesn't have a
      default value
    </p></li><li><p>
      Error: <code class="literal">1424</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_SP_NO_RECURSION</code>)
    </p><p>
      Message: Recursive stored functions and triggers are not allowed.
    </p></li><li><p>
      Error: <code class="literal">1425</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_TOO_BIG_SCALE</code>)
    </p><p>
      Message: Too big scale %d specified for column '%s'. Maximum is
      %d.
    </p></li><li><p>
      Error: <code class="literal">1426</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_TOO_BIG_PRECISION</code>)
    </p><p>
      Message: Too big precision %d specified for column '%s'. Maximum
      is %d.
    </p></li><li><p>
      Error: <code class="literal">1427</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_M_BIGGER_THAN_D</code>)
    </p><p>
      Message: For float(M,D), double(M,D) or decimal(M,D), M must be
      &gt;= D (column '%s').
    </p></li><li><p>
      Error: <code class="literal">1428</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_WRONG_LOCK_OF_SYSTEM_TABLE</code>)
    </p><p>
      Message: You can't combine write-locking of system '%s.%s' table
      with other tables
    </p></li><li><p>
      Error: <code class="literal">1429</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CONNECT_TO_FOREIGN_DATA_SOURCE</code>)
    </p><p>
      Message: Unable to connect to foreign data source: %s
    </p></li><li><p>
      Error: <code class="literal">1430</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_QUERY_ON_FOREIGN_DATA_SOURCE</code>)
    </p><p>
      Message: There was a problem processing the query on the foreign
      data source. Data source error: %s
    </p></li><li><p>
      Error: <code class="literal">1431</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST</code>)
    </p><p>
      Message: The foreign data source you are trying to reference does
      not exist. Data source error: %s
    </p></li><li><p>
      Error: <code class="literal">1432</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE</code>)
    </p><p>
      Message: Can't create federated table. The data source connection
      string '%s' is not in the correct format
    </p></li><li><p>
      Error: <code class="literal">1433</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_FOREIGN_DATA_STRING_INVALID</code>)
    </p><p>
      Message: The data source connection string '%s' is not in the
      correct format
    </p></li><li><p>
      Error: <code class="literal">1434</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANT_CREATE_FEDERATED_TABLE</code>)
    </p><p>
      Message: Can't create federated table. Foreign data src error: %s
    </p></li><li><p>
      Error: <code class="literal">1435</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_TRG_IN_WRONG_SCHEMA</code>)
    </p><p>
      Message: Trigger in wrong schema
    </p></li><li><p>
      Error: <code class="literal">1436</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_STACK_OVERRUN_NEED_MORE</code>)
    </p><p>
      Message: Thread stack overrun: %ld bytes used of a %ld byte stack,
      and %ld bytes needed. Use 'mysqld -O thread_stack=#' to specify a
      bigger stack.
    </p></li><li><p>
      Error: <code class="literal">1437</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_TOO_LONG_BODY</code>)
    </p><p>
      Message: Routine body for '%s' is too long
    </p></li><li><p>
      Error: <code class="literal">1438</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_WARN_CANT_DROP_DEFAULT_KEYCACHE</code>)
    </p><p>
      Message: Cannot drop default keycache
    </p></li><li><p>
      Error: <code class="literal">1439</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_TOO_BIG_DISPLAYWIDTH</code>)
    </p><p>
      Message: Display width out of range for column '%s' (max = %d)
    </p></li><li><p>
      Error: <code class="literal">1440</code> SQLSTATE: <code class="literal">XAE08</code>
      (<code class="literal">ER_XAER_DUPID</code>)
    </p><p>
      Message: XAER_DUPID: The XID already exists
    </p></li><li><p>
      Error: <code class="literal">1441</code> SQLSTATE: <code class="literal">22008</code>
      (<code class="literal">ER_DATETIME_FUNCTION_OVERFLOW</code>)
    </p><p>
      Message: Datetime function: %s field overflow
    </p></li><li><p>
      Error: <code class="literal">1442</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG</code>)
    </p><p>
      Message: Can't update table '%s' in stored function/trigger
      because it is already used by statement which invoked this stored
      function/trigger.
    </p></li><li><p>
      Error: <code class="literal">1443</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_VIEW_PREVENT_UPDATE</code>)
    </p><p>
      Message: The definition of table '%s' prevents operation %s on
      table '%s'.
    </p></li><li><p>
      Error: <code class="literal">1444</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_PS_NO_RECURSION</code>)
    </p><p>
      Message: The prepared statement contains a stored routine call
      that refers to that same statement. It's not allowed to execute a
      prepared statement in such a recursive manner
    </p></li><li><p>
      Error: <code class="literal">1445</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_SP_CANT_SET_AUTOCOMMIT</code>)
    </p><p>
      Message: Not allowed to set autocommit from a stored function or
      trigger
    </p></li><li><p>
      Error: <code class="literal">1446</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_MALFORMED_DEFINER</code>)
    </p><p>
      Message: Definer is not fully qualified
    </p></li><li><p>
      Error: <code class="literal">1447</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_VIEW_FRM_NO_USER</code>)
    </p><p>
      Message: View '%s'.'%s' has no definer information (old table
      format). Current user is used as definer. Please recreate the
      view!
    </p></li><li><p>
      Error: <code class="literal">1448</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_VIEW_OTHER_USER</code>)
    </p><p>
      Message: You need the SUPER privilege for creation view with
      '%s'@'%s' definer
    </p></li><li><p>
      Error: <code class="literal">1449</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_NO_SUCH_USER</code>)
    </p><p>
      Message: There is no '%s'@'%s' registered
    </p></li><li><p>
      Error: <code class="literal">1450</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_FORBID_SCHEMA_CHANGE</code>)
    </p><p>
      Message: Changing schema from '%s' to '%s' is not allowed.
    </p></li><li><p>
      Error: <code class="literal">1451</code> SQLSTATE: <code class="literal">23000</code>
      (<code class="literal">ER_ROW_IS_REFERENCED_2</code>)
    </p><p>
      Message: Cannot delete or update a parent row: a foreign key
      constraint fails (%s)
    </p></li><li><p>
      Error: <code class="literal">1452</code> SQLSTATE: <code class="literal">23000</code>
      (<code class="literal">ER_NO_REFERENCED_ROW_2</code>)
    </p><p>
      Message: Cannot add or update a child row: a foreign key
      constraint fails (%s)
    </p></li><li><p>
      Error: <code class="literal">1453</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_BAD_VAR_SHADOW</code>)
    </p><p>
      Message: Variable '%s' must be quoted with `...`, or renamed
    </p></li><li><p>
      Error: <code class="literal">1454</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_TRG_NO_DEFINER</code>)
    </p><p>
      Message: No definer attribute for trigger '%s'.'%s'. The trigger
      will be activated under the authorization of the invoker, which
      may have insufficient privileges. Please recreate the trigger.
    </p></li><li><p>
      Error: <code class="literal">1455</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_OLD_FILE_FORMAT</code>)
    </p><p>
      Message: '%s' has an old format, you should re-create the '%s'
      object(s)
    </p></li><li><p>
      Error: <code class="literal">1456</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_SP_RECURSION_LIMIT</code>)
    </p><p>
      Message: Recursive limit %d (as set by the max_sp_recursion_depth
      variable) was exceeded for routine %s
    </p></li><li><p>
      Error: <code class="literal">1457</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_SP_PROC_TABLE_CORRUPT</code>)
    </p><p>
      Message: Failed to load routine %s. The table mysql.proc is
      missing, corrupt, or contains bad data (internal code %d)
    </p></li><li><p>
      Error: <code class="literal">1458</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_WRONG_NAME</code>)
    </p><p>
      Message: Incorrect routine name '%s'
    </p></li><li><p>
      Error: <code class="literal">1459</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_TABLE_NEEDS_UPGRADE</code>)
    </p><p>
      Message: Table upgrade required. Please do "REPAIR TABLE `%s`" to
      fix it!
    </p></li><li><p>
      Error: <code class="literal">1460</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_SP_NO_AGGREGATE</code>)
    </p><p>
      Message: AGGREGATE is not supported for stored functions
    </p></li><li><p>
      Error: <code class="literal">1461</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_MAX_PREPARED_STMT_COUNT_REACHED</code>)
    </p><p>
      Message: Can't create more than max_prepared_stmt_count statements
      (current value: %lu)
    </p></li><li><p>
      Error: <code class="literal">1462</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_VIEW_RECURSIVE</code>)
    </p><p>
      Message: `%s`.`%s` contains view recursion
    </p></li><li><p>
      Error: <code class="literal">1463</code> SQLSTATE: <code class="literal">42000</code>
      (<code class="literal">ER_NON_GROUPING_FIELD_USED</code>)
    </p><p>
      Message: non-grouping field '%s' is used in %s clause
    </p></li><li><p>
      Error: <code class="literal">1464</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_TABLE_CANT_HANDLE_SPKEYS</code>)
    </p><p>
      Message: The used table type doesn't support SPATIAL indexes
    </p></li><li><p>
      Error: <code class="literal">1465</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA</code>)
    </p><p>
      Message: Triggers can not be created on system tables
    </p></li><li><p>
      Error: <code class="literal">1466</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_REMOVED_SPACES</code>)
    </p><p>
      Message: Leading spaces are removed from name '%s'
    </p></li><li><p>
      Error: <code class="literal">1467</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_AUTOINC_READ_FAILED</code>)
    </p><p>
      Message: Failed to read auto-increment value from storage engine
    </p></li><li><p>
      Error: <code class="literal">1468</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_USERNAME</code>)
    </p><p>
      Message: user name
    </p></li><li><p>
      Error: <code class="literal">1469</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_HOSTNAME</code>)
    </p><p>
      Message: host name
    </p></li><li><p>
      Error: <code class="literal">1470</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_WRONG_STRING_LENGTH</code>)
    </p><p>
      Message: String '%s' is too long for %s (should be no longer than
      %d)
    </p></li><li><p>
      Error: <code class="literal">1471</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_NON_INSERTABLE_TABLE</code>)
    </p><p>
      Message: The target table %s of the %s is not insertable-into
    </p></li><li><p>
      Error: <code class="literal">1472</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_ADMIN_WRONG_MRG_TABLE</code>)
    </p><p>
      Message: Table '%s' is differently defined or of non-MyISAM type
      or doesn't exist
    </p></li><li><p>
      Error: <code class="literal">1473</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT</code>)
    </p><p>
      Message: Too high level of nesting for select
    </p></li><li><p>
      Error: <code class="literal">1474</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_NAME_BECOMES_EMPTY</code>)
    </p><p>
      Message: Name '%s' has become ''
    </p></li><li><p>
      Error: <code class="literal">1475</code> SQLSTATE: <code class="literal">HY000</code>
      (<code class="literal">ER_AMBIGUOUS_FIELD_TERM</code>)
    </p><p>
      Message: First character of the FIELDS TERMINATED string is
      ambiguous; please use non-optional and non-empty FIELDS ENCLOSED
      BY
    </p></li></ul></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="error-messages-client"></a>B.3. Client Error Codes and Messages</h2></div></div></div><p>
      Client error information comes from the following source files:
    </p><div class="itemizedlist"><ul type="disc"><li><p>
          The Error values and the symbols in parentheses correspond to
          definitions in the <code class="filename">include/errmsg.h</code> MySQL
          source file.
        </p></li><li><p>
          The Message values correspond to the error messages that are
          listed in the <code class="filename">libmysql/errmsg.c</code> file.
          <code class="literal">%d</code> and <code class="literal">%s</code> represent
          numbers and strings, respectively, that are substituted into
          the messages when they are displayed.
        </p></li></ul></div><p>
      Because updates are frequent, it is possible that those files will
      contain additional error information not listed here.
    </p><div class="itemizedlist"><ul type="disc"><li><p>
      Error: <code class="literal">2000</code>
      (<code class="literal">CR_UNKNOWN_ERROR</code>)
    </p><p>
      Message: Unknown MySQL error
    </p></li><li><p>
      Error: <code class="literal">2001</code>
      (<code class="literal">CR_SOCKET_CREATE_ERROR</code>)
    </p><p>
      Message: Can't create UNIX socket (%d)
    </p></li><li><p>
      Error: <code class="literal">2002</code>
      (<code class="literal">CR_CONNECTION_ERROR</code>)
    </p><p>
      Message: Can't connect to local MySQL server through socket '%s'
      (%d)
    </p></li><li><p>
      Error: <code class="literal">2003</code>
      (<code class="literal">CR_CONN_HOST_ERROR</code>)
    </p><p>
      Message: Can't connect to MySQL server on '%s' (%d)
    </p></li><li><p>
      Error: <code class="literal">2004</code>
      (<code class="literal">CR_IPSOCK_ERROR</code>)
    </p><p>
      Message: Can't create TCP/IP socket (%d)
    </p></li><li><p>
      Error: <code class="literal">2005</code>
      (<code class="literal">CR_UNKNOWN_HOST</code>)
    </p><p>
      Message: Unknown MySQL server host '%s' (%d)
    </p></li><li><p>
      Error: <code class="literal">2006</code>
      (<code class="literal">CR_SERVER_GONE_ERROR</code>)
    </p><p>
      Message: MySQL server has gone away
    </p></li><li><p>
      Error: <code class="literal">2007</code>
      (<code class="literal">CR_VERSION_ERROR</code>)
    </p><p>
      Message: Protocol mismatch; server version = %d, client version =
      %d
    </p></li><li><p>
      Error: <code class="literal">2008</code>
      (<code class="literal">CR_OUT_OF_MEMORY</code>)
    </p><p>
      Message: MySQL client ran out of memory
    </p></li><li><p>
      Error: <code class="literal">2009</code>
      (<code class="literal">CR_WRONG_HOST_INFO</code>)
    </p><p>
      Message: Wrong host info
    </p></li><li><p>
      Error: <code class="literal">2010</code>
      (<code class="literal">CR_LOCALHOST_CONNECTION</code>)
    </p><p>
      Message: Localhost via UNIX socket
    </p></li><li><p>
      Error: <code class="literal">2011</code>
      (<code class="literal">CR_TCP_CONNECTION</code>)
    </p><p>
      Message: %s via TCP/IP
    </p></li><li><p>
      Error: <code class="literal">2012</code>
      (<code class="literal">CR_SERVER_HANDSHAKE_ERR</code>)
    </p><p>
      Message: Error in server handshake
    </p></li><li><p>
      Error: <code class="literal">2013</code> (<code class="literal">CR_SERVER_LOST</code>)
    </p><p>
      Message: Lost connection to MySQL server during query
    </p></li><li><p>
      Error: <code class="literal">2014</code>
      (<code class="literal">CR_COMMANDS_OUT_OF_SYNC</code>)
    </p><p>
      Message: Commands out of sync; you can't run this command now
    </p></li><li><p>
      Error: <code class="literal">2015</code>
      (<code class="literal">CR_NAMEDPIPE_CONNECTION</code>)
    </p><p>
      Message: Named pipe: %s
    </p></li><li><p>
      Error: <code class="literal">2016</code>
      (<code class="literal">CR_NAMEDPIPEWAIT_ERROR</code>)
    </p><p>
      Message: Can't wait for named pipe to host: %s pipe: %s (%lu)
    </p></li><li><p>
      Error: <code class="literal">2017</code>
      (<code class="literal">CR_NAMEDPIPEOPEN_ERROR</code>)
    </p><p>
      Message: Can't open named pipe to host: %s pipe: %s (%lu)
    </p></li><li><p>
      Error: <code class="literal">2018</code>
      (<code class="literal">CR_NAMEDPIPESETSTATE_ERROR</code>)
    </p><p>
      Message: Can't set state of named pipe to host: %s pipe: %s (%lu)
    </p></li><li><p>
      Error: <code class="literal">2019</code>
      (<code class="literal">CR_CANT_READ_CHARSET</code>)
    </p><p>
      Message: Can't initialize character set %s (path: %s)
    </p></li><li><p>
      Error: <code class="literal">2020</code>
      (<code class="literal">CR_NET_PACKET_TOO_LARGE</code>)
    </p><p>
      Message: Got packet bigger than 'max_allowed_packet' bytes
    </p></li><li><p>
      Error: <code class="literal">2021</code>
      (<code class="literal">CR_EMBEDDED_CONNECTION</code>)
    </p><p>
      Message: Embedded server
    </p></li><li><p>
      Error: <code class="literal">2022</code>
      (<code class="literal">CR_PROBE_SLAVE_STATUS</code>)
    </p><p>
      Message: Error on SHOW SLAVE STATUS:
    </p></li><li><p>
      Error: <code class="literal">2023</code>
      (<code class="literal">CR_PROBE_SLAVE_HOSTS</code>)
    </p><p>
      Message: Error on SHOW SLAVE HOSTS:
    </p></li><li><p>
      Error: <code class="literal">2024</code>
      (<code class="literal">CR_PROBE_SLAVE_CONNECT</code>)
    </p><p>
      Message: Error connecting to slave:
    </p></li><li><p>
      Error: <code class="literal">2025</code>
      (<code class="literal">CR_PROBE_MASTER_CONNECT</code>)
    </p><p>
      Message: Error connecting to master:
    </p></li><li><p>
      Error: <code class="literal">2026</code>
      (<code class="literal">CR_SSL_CONNECTION_ERROR</code>)
    </p><p>
      Message: SSL connection error
    </p></li><li><p>
      Error: <code class="literal">2027</code>
      (<code class="literal">CR_MALFORMED_PACKET</code>)
    </p><p>
      Message: Malformed packet
    </p></li><li><p>
      Error: <code class="literal">2028</code>
      (<code class="literal">CR_WRONG_LICENSE</code>)
    </p><p>
      Message: This client library is licensed only for use with MySQL
      servers having '%s' license
    </p></li><li><p>
      Error: <code class="literal">2029</code>
      (<code class="literal">CR_NULL_POINTER</code>)
    </p><p>
      Message: Invalid use of null pointer
    </p></li><li><p>
      Error: <code class="literal">2030</code>
      (<code class="literal">CR_NO_PREPARE_STMT</code>)
    </p><p>
      Message: Statement not prepared
    </p></li><li><p>
      Error: <code class="literal">2031</code>
      (<code class="literal">CR_PARAMS_NOT_BOUND</code>)
    </p><p>
      Message: No data supplied for parameters in prepared statement
    </p></li><li><p>
      Error: <code class="literal">2032</code>
      (<code class="literal">CR_DATA_TRUNCATED</code>)
    </p><p>
      Message: Data truncated
    </p></li><li><p>
      Error: <code class="literal">2033</code>
      (<code class="literal">CR_NO_PARAMETERS_EXISTS</code>)
    </p><p>
      Message: No parameters exist in the statement
    </p></li><li><p>
      Error: <code class="literal">2034</code>
      (<code class="literal">CR_INVALID_PARAMETER_NO</code>)
    </p><p>
      Message: Invalid parameter number
    </p></li><li><p>
      Error: <code class="literal">2035</code>
      (<code class="literal">CR_INVALID_BUFFER_USE</code>)
    </p><p>
      Message: Can't send long data for non-string/non-binary data types
      (parameter: %d)
    </p></li><li><p>
      Error: <code class="literal">2036</code>
      (<code class="literal">CR_UNSUPPORTED_PARAM_TYPE</code>)
    </p><p>
      Message: Using unsupported buffer type: %d (parameter: %d)
    </p></li><li><p>
      Error: <code class="literal">2037</code>
      (<code class="literal">CR_SHARED_MEMORY_CONNECTION</code>)
    </p><p>
      Message: Shared memory: %s
    </p></li><li><p>
      Error: <code class="literal">2038</code>
      (<code class="literal">CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR</code>)
    </p><p>
      Message: Can't open shared memory; client could not create request
      event (%lu)
    </p></li><li><p>
      Error: <code class="literal">2039</code>
      (<code class="literal">CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR</code>)
    </p><p>
      Message: Can't open shared memory; no answer event received from
      server (%lu)
    </p></li><li><p>
      Error: <code class="literal">2040</code>
      (<code class="literal">CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR</code>)
    </p><p>
      Message: Can't open shared memory; server could not allocate file
      mapping (%lu)
    </p></li><li><p>
      Error: <code class="literal">2041</code>
      (<code class="literal">CR_SHARED_MEMORY_CONNECT_MAP_ERROR</code>)
    </p><p>
      Message: Can't open shared memory; server could not get pointer to
      file mapping (%lu)
    </p></li><li><p>
      Error: <code class="literal">2042</code>
      (<code class="literal">CR_SHARED_MEMORY_FILE_MAP_ERROR</code>)
    </p><p>
      Message: Can't open shared memory; client could not allocate file
      mapping (%lu)
    </p></li><li><p>
      Error: <code class="literal">2043</code>
      (<code class="literal">CR_SHARED_MEMORY_MAP_ERROR</code>)
    </p><p>
      Message: Can't open shared memory; client could not get pointer to
      file mapping (%lu)
    </p></li><li><p>
      Error: <code class="literal">2044</code>
      (<code class="literal">CR_SHARED_MEMORY_EVENT_ERROR</code>)
    </p><p>
      Message: Can't open shared memory; client could not create %s
      event (%lu)
    </p></li><li><p>
      Error: <code class="literal">2045</code>
      (<code class="literal">CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR</code>)
    </p><p>
      Message: Can't open shared memory; no answer from server (%lu)
    </p></li><li><p>
      Error: <code class="literal">2046</code>
      (<code class="literal">CR_SHARED_MEMORY_CONNECT_SET_ERROR</code>)
    </p><p>
      Message: Can't open shared memory; cannot send request event to
      server (%lu)
    </p></li><li><p>
      Error: <code class="literal">2047</code>
      (<code class="literal">CR_CONN_UNKNOW_PROTOCOL</code>)
    </p><p>
      Message: Wrong or unknown protocol
    </p></li><li><p>
      Error: <code class="literal">2048</code>
      (<code class="literal">CR_INVALID_CONN_HANDLE</code>)
    </p><p>
      Message: Invalid connection handle
    </p></li><li><p>
      Error: <code class="literal">2049</code> (<code class="literal">CR_SECURE_AUTH</code>)
    </p><p>
      Message: Connection using old (pre-4.1.1) authentication protocol
      refused (client option 'secure_auth' enabled)
    </p></li><li><p>
      Error: <code class="literal">2050</code>
      (<code class="literal">CR_FETCH_CANCELED</code>)
    </p><p>
      Message: Row retrieval was canceled by mysql_stmt_close() call
    </p></li><li><p>
      Error: <code class="literal">2051</code> (<code class="literal">CR_NO_DATA</code>)
    </p><p>
      Message: Attempt to read column without prior row fetch
    </p></li><li><p>
      Error: <code class="literal">2052</code>
      (<code class="literal">CR_NO_STMT_METADATA</code>)
    </p><p>
      Message: Prepared statement contains no metadata
    </p></li><li><p>
      Error: <code class="literal">2053</code>
      (<code class="literal">CR_NO_RESULT_SET</code>)
    </p><p>
      Message: Attempt to read a row while there is no result set
      associated with the statement
    </p></li><li><p>
      Error: <code class="literal">2054</code>
      (<code class="literal">CR_NOT_IMPLEMENTED</code>)
    </p><p>
      Message: This feature is not implemented yet
    </p></li><li><p>
      Error: <code class="literal">2055</code>
      (<code class="literal">CR_SERVER_LOST_EXTENDED</code>)
    </p><p>
      Message: Lost connection to MySQL server at '%s', system error: %d
    </p></li></ul></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="faqs.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="releasenotes-es.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix A. MySQL 5.0 Frequently Asked Questions </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Appendix C. MySQL Enterprise Release Notes</td></tr></table></div></body></html>