MySQL FAQ collection

Source: Internet
Author: User

FAQ Gallery

MySQL always crashes

First you should try to figure out whether the mysqld daemon is dead or if your problem is related to your customer. You can use Mysqladmin version to check how long your mysqld server is performing properly, and if Mysqld is dead, you can find the reason in file "mysql-data-directory/' hostname '. Err".

Some common errors when using MySQL

MySQL server has gone away

A common cause is that the server timed out and closed the connection. By default, if nothing happens, the server closes the connection after 8 hours. You can change the time limit by setting the Wait_timeout variable when starting mysqld.

If Mysqld gets a packet that is too large or not normal, it thinks the customer has made a mistake and closes the connection.

Can ' t connect to [local] MySQL server

Usually means that no MySQL server is running on the system or when trying to connect to the MYSQLD server, you are using an incorrect socket file or TCP/IP port.

Check (use PS) if a process named Mysqld is started on the server

If a mysqld process is running, you can check the server by trying these different connections

Shell> mysqladmin Version

Shell> mysqladmin variables

shell> mysqladmin-h ' hostname ' version variables

shell> mysqladmin-h ' hostname '--port=3306 version

shell> mysqladmin-h ' IP for your host ' version

shell> mysqladmin--socket=/tmp/mysql.sock Version

Note that the hostname command uses the inverted quote "'" instead of the positive quotation mark "'", which causes the hostname output (that is, the current hostname) to be substituted for the mysqladmin command.
Host ' ... ' is blocked error

Host ' hostname ' is blocked because of many connection errors.

Unblock with ' mysqladmin flush-hosts '

This means that mysqld has got a large number of (max_connect_errors) hosts ' hostname ' in the middle of the interrupted connection request. After max_connect_errors a failed request, MYSQLD identified an error (like a hacker's attack) and blocked the site from further connections until someone executed the command mysqladmin flush-hosts.

By default, mysqld blocks a single host after 10 connection errors. You can easily adjust it by starting a server like this:

Shell> safe_mysqld-o max_connect_errors=10000 &

Too Many connections error

means that there are already max_connections clients connected to the MYSQLD server.

If you need more connections than the default (100), then you should reboot the mysqld with a larger max_connections variable value.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.