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