Ubuntu MySQL database can't create/write to file (errno13)

Source: Internet
Author: User

I installed ubuntu8.04,
All previous operations
In the ubuntu8.04 environment, MySQL is installed with the new version. There is no problem in starting the server. you can log on to the database and create a table.
An error occurs when I describe the table:
Mysql> desc pet;
Error 1 (hy000): Can't create/write to file '/tmp/# SQL _157f_0.myi' (errcode: 13 );

Sudo/etc/init. d/MySQL start server

Mysql-u root-P + Password Logon
I have added permissions to the root user.
Mysql> grant allprivileges on *. * to root @ localhost;
For
Tmpdir =/tmp
I have modified her permissions.
Desktop $ sudo chown root: Root/tmp
Desktop $ sudo chmod 1777/tmp
However, the DESC + table cannot be used in any case;
In addition, I add data to the table, delete the data, and query the data. This is really an emergency.
I just saw a post on the Internet, which is the same as my problem.
Someone replied:

Try the following:
1. mkdir/var/lib/MySQL/tmp
2. chmod MYSQL: MySQL/var/lib/MySQL/tmp
3. Add the following line into the [MySQL] section: tmpdir =/var/lib/MySQL/tmp
4. Restart the server

I tried the following operations:
1. No problem. Create a folder/var/lib/MySQL/tmp.
2. There must be a problem. I have never found such a usage. Maybe this post is for the experts. After half a day of reflection, I learned that:
Chown MYSQL: MySQL/var/lib/MySQL/tmp (view the functions and usage of CHMOD and chown on your own)
3. It seems that there is no problem. In fact, there is a problem. What he says is "add", which means not "add", but "modify ".
4. No problem
After modification, my MySQL runs normally.
Mysql> desc pet;
+ --------- + ---------- + ------ + ----- + --------- + ------- +
| FIELD | type | null | key | default | extra |
+ --------- + ---------- + ------ + ----- + --------- + ------- +
| Name | char (10) | Yes | null |
| Address | char (20) | Yes | null |
+ --------- + ---------- + ------ + ----- + --------- + ------- +

This problem has plagued me for a month. I hope it will help people with lofty ideals who encounter or may encounter such problems in the future.
Of course, systems and machines may be different!

this article from the csdn blog, reprinted please indicate the source: http://blog.csdn.net/weihua1984/archive/2009/11/23/4854280.aspx

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.