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