MySQL error 1036: table is read only

前端 未结 6 1964
醉话见心
醉话见心 2021-01-11 22:53

When im trying to insert a record to the table using phpmyadmin it gives me

#1036 - Table \'sch_portfolio\' is read only 

I saw in some art

相关标签:
6条回答
  • 2021-01-11 23:15

    According to me, this is because of storage engine . If you select storage engine as MRG_MYISAM then that will make your table only readable, you can't insert data. So, select myisam as storage engine ..

    0 讨论(0)
  • 2021-01-11 23:16

    You can change the Storage Engine so you don't have to replace settings. If you set it to InnoDB you're problem sould be solved. ( Changing it can be don in the operations tab in phpmyadmin)

    0 讨论(0)
  • 2021-01-11 23:19

    Make sure you have not set innodb_force_recovery > 0 in my.cnf

    0 讨论(0)
  • 2021-01-11 23:21

    One needs super user privs to do this, most commonly sudo is used to acheve this.

    in order too Change the owner of the files.

    sudo chown -R mysql:mysql /var/lib/mysql
    

    Reboot Mysql for the changes

    sudo service mysql restart
    

    who owns sch_portfolio and what group are they in, should be mysql:mysql. you'll also need to restart mysql for changes to take affect

    also check that the currently logged in user had GRANT access to update

    The MySQL server is running as user mysql and not as the user I logged into it with. In order for it to access files that have user only rights they must be owned by user ‘mysql’ since that is what the server is running as. Make sure the folder and files used by mysql belong to the user ‘mysql’. These files are located in the /var/lib/mysql directory. The directory itself should also belong to ‘mysql’.

    0 讨论(0)
  • 2021-01-11 23:32

    I suspect that in my case, this was caused by a hidden anti malware antivirus Bytefence (probably, it was bundled with something else). The problem was gone after uninstalling this antivirus.

    0 讨论(0)
  • 2021-01-11 23:40

    i had a similar problem and the solution for me was to change the owner/group of the table files to mysql. you can do two options

    1

    for first you have to go in your server and get privilegies

    sudo su
    

    and then i went to the hidden folder mysql doing:

    cd /var/lib/mysql/
    

    and then i ran this command:

    chown -R mysql:mysql *
    

    and this will solve your problem

    then to see if it works you have to reboot the mysql

    service mysql restart
    

    2

    or you can simply go to phpmyadmin then to your database select all the tables and then you have to select option repair (sorry i got phpmyadmin in italian) you can do this also in bash,

    and this will work! if no option work try to reinstall mysql

    0 讨论(0)
提交回复
热议问题