Mysql desc: ERROR 1 (HY000): Can & #39; t create/write to fi

Source: Internet
Author: User

When using mysql, when I want to use desc to view the table structure, the following error message is displayed:

ERROR 1 (HY000): Can't create/write to file '/tmp/#sql_1737_0.MYI' (Errcode: 13)

I have never met anyone. I searched the internet. The chances of this problem are still high. Haha !! Solution

Find the mysql installation directory. Note: If you compile and install mysql, go to the mysql directory you compile and install. If yum is installed, go to the default installation directory, here I will use the compilation and installation.

[root@DB tmp]# cd /usr/local/mysql/[root@DB mysql]# lltotal 80drwxr-xr-x  2 root  root  4096 Aug 21 17:53 bindrwxr-xr-x  7 mysql mysql 4096 Sep 11 19:43 datadrwxr-xr-x  2 root  root  4096 Aug 21 17:31 docsdrwxr-xr-x  3 root  root  4096 Aug 21 17:31 includedrwxr-xr-x  3 root  root  4096 Aug 21 17:31 libdrwxr-xr-x  2 root  root  4096 Aug 21 17:46 libexecdrwxr-xr-x 10 root  root  4096 Aug 21 17:46 mysql-testdrwxr-xr-x  5 root  root  4096 Aug 21 17:46 sharedrwxr-xr-x  5 root  root  4096 Aug 21 17:46 sql-benchdrwxr-xr-x  2 mysql root  4096 Sep 11 19:43 tmp

Okay, here is our tmp, so let's take a look at our configuration file.

[mysqld]port            = 3306socket          = /usr/local/mysql/tmp/mysql.sockskip-lockingkey_buffer_size = 16Kmax_allowed_packet = 1Mtable_open_cache = 4sort_buffer_size = 64Kread_buffer_size = 256Kread_rnd_buffer_size = 256Knet_buffer_length = 2Kthread_stack = 128K

Oh? The tmpdir path is not specified. Okay, add the following line here:

Tmpdir =/usr/local/mysql/tmp

Save and exit ~

Restart mysql and then enter mysql. The problem has been solved.

This article from the "wind don't Crane" blog, please be sure to keep this source http://addam.blog.51cto.com/5041993/1297810

Related Article

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.