Unable to modify table

I have problems with mysql. I can read and write, but now I want to add some fields to the table. I ran this command:   ALTER TABLE Pubs ADD COLUMN issue tinyint AFTER volume;

but get this error message:   ERROR 7 (HY000): Error on rename of './user_acct/Pubs.MYI' to './user_acct/#sql2-cb0-76f2.MYI' (Errcode: 13)

I created this table a few months ago, modified it a bit, so then it worked. I can still update and insert elements, but I can no longer modify the table.

Any help would be appreciated.

- Dave

+3
source share
4 answers

You can use perror for undesrtand mysql error:

$ perror 13
OS error code  13:  Permission denied
+2
source

Does a MySQL user on the system have permission to write to the folder ./user_acct/?

0
source

:

mysql>  rename table BL_Backup.TMP_BL_transaction_02  to BL_Backup.BL_transaction_02;
ERROR 7 (HY000): Error on rename of './BL_Backup/TMP_BL_transaction_02.MYI' to './BL_Backup/BL_transaction_02.MYI' (Errcode: 13)

[root@s4 Db_Backup]# ll
total 52
drwxr-xr-x  2 root  root   4096 Sep 28 18:19 BL_Backup
drwx------  2 mysql mysql 49152 May 19 15:59 mauj_2010_2011

[root@s4 Db_Backup]# chown mysql:mysql BL_Backup

[root@s4 Db_Backup]# ll
total 52
drwxr-xr-x  2 mysql mysql  4096 Sep 28 18:19 BL_Backup
drwx------  2 mysql mysql 49152 May 19 15:59 mauj_2010_2011

mysql>  rename table TMP_BL_transaction_02  to BL_transaction_02;   
Query OK, 0 rows affected (0.00 sec)
0

. errcode 13, , .frm MyISAM, .

, ubuntu ( ) - mysql /tmp, .

root root /tmp/upgrade-XX-X/var/.wh..wh.afs

, "dmesg" , .

[111111111.222222] type=1503 audit(1862.6:7):  operation="link" 
    pid=<> parent=1 profile="/usr/sbin/mysqld" requested_mask="::l" 
    denied_mask="::l" fsuid=<> ouid=<> 
    name="/tmp/upgrade-XX-X/var/lib/mysql/<dbname>" 
    name2="/tmp/upgrade-XX-X/var/.wh..wh.aufs"

, mysql ?

chmod 777 .wh , chown mysql:mysql .

0

Source: https://habr.com/ru/post/1746325/


All Articles