这篇文章主要为大家展示了“MySQL报错Table 'plugin' is read only [ERROR] Can't open the mysql.plugin table怎么办”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“MySQL报错Table 'plugin' is read only [ERROR] Can't open the mysql.plugin table怎么办”这篇文章吧。

迁移MySQL数据库的时候,发生了下面的报错

18120514:10:22mysqld_safeStartingmysqlddaemonwithdatabasesfrom/data/mysql_3308/2018-12-0514:10:2218964[Warning]Youneedtouse--log-bintomake--log-slave-updateswork.2018-12-0514:10:2218964[Warning]Youneedtouse--log-bintomake--binlog-formatwork.2018-12-0514:10:2218964[Note]Plugin'FEDERATED'isdisabled./usr/sbin/mysqld:Table'plugin'isreadonly2018-12-0514:10:2218964[ERROR]Can'topenthemysql.plugintable.Pleaserunmysql_upgradetocreateit.2018-12-0514:10:227fe3f219b740InnoDB:Warning:Usinginnodb_additional_mem_pool_sizeisDEPRECATED.Thisoptionmayberemovedinfuturereleases,togetherwiththeoptioninnodb_use_sys_mallocandwiththeInnoDB'sinternalmemoryallocator.2018-12-0514:10:2218964[Note]InnoDB:Usingatomicstorefcountbufferpoolpages2018-12-0514:10:2218964[Note]InnoDB:TheInnoDBmemoryheapisdisabled2018-12-0514:10:2218964[Note]InnoDB:Mutexesandrw_locksuseGCCatomicbuiltins2018-12-0514:10:2218964[Note]InnoDB:Memorybarrierisnotused2018-12-0514:10:2218964[Note]InnoDB:Compressedtablesusezlib1.2.32018-12-0514:10:2218964[Note]InnoDB:UsingLinuxnativeAIO2018-12-0514:10:2218964[Note]InnoDB:UsingCPUcrc32instructions2018-12-0514:10:2218964[Note]InnoDB:Initializingbufferpool,size=4.0G2018-12-0514:10:2218964[Note]InnoDB:Completedinitializationofbufferpool2018-12-0514:10:2318964[Note]InnoDB:HighestsupportedfileformatisBarracuda.2018-12-0514:10:2318964[Note]InnoDB:128rollbacksegment(s)areactive.2018-12-0514:10:2318964[Note]InnoDB:Waitingforpurgetostart06:10:23UTC-mysqldgotsignal11;Thiscouldbebecauseyouhitabug.Itisalsopossiblethatthisbinaryoroneofthelibrariesitwaslinkedagainstiscorrupt,improperlybuilt,ormisconfigured.Thiserrorcanalsobecausedbymalfunctioninghardware.Wewilltryourbesttoscrapeupsomeinfothatwillhopefullyhelpdiagnosetheproblem,butsincewehavealreadycrashed,somethingisdefinitelywrongandthismayfail.key_buffer_size=8388608read_buffer_size=131072max_used_connections=0max_threads=2000thread_count=0connection_count=0Itispossiblethatmysqldcoulduseuptokey_buffer_size+(read_buffer_size+sort_buffer_size)*max_threads=4387598KbytesofmemoryHopethat'sok;ifnot,decreasesomevariablesintheequation.Threadpointer:0x0Attemptingbacktrace.Youcanusethefollowinginformationtofindoutwheremysqlddied.Ifyouseenomessagesafterthis,somethingwentterriblywrong...stack_bottom=0thread_stack0x40000/usr/sbin/mysqld(my_print_stacktrace+0x3b)[0x8dd30b]/usr/sbin/mysqld(handle_fatal_signal+0x491)[0x6720b1]/lib64/libpthread.so.0(+0xf6d0)[0x7fe3f1d7c6d0]/usr/sbin/mysqld(my_realpath+0x87)[0x8da5d7]/usr/sbin/mysqld(_Z19find_or_create_fileP10PFS_threadP14PFS_file_classPKcjb+0x9c)[0xabaddc]

报错提示plugin表只读,无法正常打开。

查看对应数据目录的权限,已经授予了mysql的所属权限。

[root@bi-multi-mysql-d9mysql_3307]#ls-trltotal3621384drwxr-xr-x2mysql2mysql210Jul132017test-rwxr-xr-x1mysql2mysql2536870912Jul132017ib_logfile1-rwxr-xr-x1mysql2mysql2536870912Jul132017ib_logfile2drwxr-xr-x2mysql2mysql24096Jul132017performance_schema-rwxr-xr-x1mysql2mysql2431Jul132017mysql-bin.000001drwxr-xr-x2mysql2mysql28192Jul132017mysql-rwxr-xr-x1mysql2mysql2143Jul132017mysql-bin.000002-rwxr-xr-x1mysql2mysql257Jul132017mysql-bin.index-rwxr-xr-x1mysql2mysql256Jul132017auto.cnf-rwxr-xr-x1mysql2mysql2109302Jul142017mysql-bin.000003drwxr-xr-x2mysql2mysql24096Sep2909:12jolly_alliance_center-rwxr-xr-x1mysql2mysql2221Dec512:20mysqld-relay-bin.000670-rwxr-xr-x1mysql2mysql252Dec512:20mysqld-relay-bin.index-rwxr-xr-x1mysql2mysql269Dec515:08relay-log.info-rwxr-xr-x1mysql2mysql2358775Dec515:08mysqld-relay-bin.000671-rwxr-xr-x1mysql2mysql2137Dec515:08master.info-rwxr-xr-x1mysql2mysql2536870912Dec516:37ib_logfile0-rwxr-xr-x1mysql2mysql21048576000Dec516:37ibdata2-rwxr-xr-x1mysql2mysql21048576000Dec516:37ibdata1

报错的原因:

mysql操作系统用户的权限被修改,无法进入数据目录,进而导致报错。

数据目录是/data/mysql_3307,mysql操作系统用户无法进入/data。

修改权限后,恢复正常。

以上是“MySQL报错Table 'plugin' is read only [ERROR] Can't open the mysql.plugin table怎么办”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!