MySQL 啟動(dòng)報(bào)錯(cuò)Table 'mysql.plugin' doesn't exis(轉(zhuǎn)載)

安裝完成后乌妒,按照網(wǎng)上說啟動(dòng)mysql時(shí)卻報(bào)了以下錯(cuò)誤:

[root@localhost bin]# ./mysqld

2015-10-23 16:54:55 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2015-10-23 16:54:55 0 [Note] ./mysqld (mysqld 5.6.27) starting as process 31176 ...

2015-10-23 16:54:55 31176 [Warning] Can't create test file /data/mysql/localhost.lower-test

2015-10-23 16:54:55 31176 [Warning] Can't create test file /data/mysql/localhost.lower-test

./mysqld: Can't change dir to '/data/mysql/' (Errcode: 2 - No such file or directory)

2015-10-23 16:54:55 31176 [ERROR] Aborting

2015-10-23 16:54:55 31176 [Note] Binlog end

2015-10-23 16:54:55 31176 [Note] ./mysqld: Shutdown complete

網(wǎng)上的解決方法有很多候味,有些我試過不管用垃你,但不能就說這些不管用的文章是亂寫的铺敌,因?yàn)橛行﹩栴}并不是由一個(gè)原因而引起的私杜,不過可以試試遭商,我對(duì)mysql了解不多宪巨,所以也不加以評(píng)論,我是使用以下方法解決的:

首先這個(gè)報(bào)錯(cuò)对竣,很明顯是由于找不到datadir目錄/data/mysql/所引起的庇楞,其實(shí)我安裝mysql時(shí)候是指定了datadir=/usr/mysqldata,于是我在usr創(chuàng)建了mysqldata目錄:

[root@localhost usr]# mkdir -p /usr/mysqldata/

[root@localhost usr]# ls

[root@localhost usr]# chown -R mysql mysqldata

[root@localhost usr]# chgrp -R mysql mysqldata

然后再啟動(dòng)否纬,不過仍然報(bào)錯(cuò):

[root@localhost bin]# ./mysqld

2015-10-23 17:06:33 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2015-10-23 17:06:33 0 [Note] ./mysqld (mysqld 5.6.27) starting as process 31312 ...

2015-10-23 17:06:33 31312 [Note] Plugin 'FEDERATED' is disabled.

./mysqld: Table 'mysql.plugin' doesn't exist

2015-10-23 17:06:33 31312 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

2015-10-23 17:06:33 31312 [Note] InnoDB: Using atomics to ref count buffer pool pages

2015-10-23 17:06:33 31312 [Note] InnoDB: The InnoDB memory heap is disabled

2015-10-23 17:06:33 31312 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2015-10-23 17:06:33 31312 [Note] InnoDB: Memory barrier is not used

2015-10-23 17:06:33 31312 [Note] InnoDB: Compressed tables use zlib 1.2.3

2015-10-23 17:06:33 31312 [Note] InnoDB: Using CPU crc32 instructions

2015-10-23 17:06:33 31312 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2015-10-23 17:06:33 31312 [Note] InnoDB: Completed initialization of buffer pool

2015-10-23 17:06:33 31312 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!

2015-10-23 17:06:33 31312 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB

2015-10-23 17:06:33 31312 [Note] InnoDB: Database physically writes the file full: wait...

2015-10-23 17:06:33 31312 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB

2015-10-23 17:06:34 31312 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB

2015-10-23 17:06:34 31312 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0

2015-10-23 17:06:34 31312 [Warning] InnoDB: New log files created, LSN=45781

2015-10-23 17:06:34 31312 [Note] InnoDB: Doublewrite buffer not found: creating new

2015-10-23 17:06:34 31312 [Note] InnoDB: Doublewrite buffer created

2015-10-23 17:06:34 31312 [Note] InnoDB: 128 rollback segment(s) are active.

2015-10-23 17:06:34 31312 [Warning] InnoDB: Creating foreign key constraint system tables.

2015-10-23 17:06:34 31312 [Note] InnoDB: Foreign key constraint system tables created

2015-10-23 17:06:34 31312 [Note] InnoDB: Creating tablespace and datafile system tables.

2015-10-23 17:06:34 31312 [Note] InnoDB: Tablespace and datafile system tables created.

2015-10-23 17:06:34 31312 [Note] InnoDB: Waiting for purge to start

2015-10-23 17:06:34 31312 [Note] InnoDB: 5.6.27 started; log sequence number 0

2015-10-23 17:06:34 31312 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 5bed1721-7965-11e5-a520-000c299a432a.

2015-10-23 17:06:34 31312 [Note] Server hostname (bind-address): '*'; port: 3306

2015-10-23 17:06:34 31312 [Note] IPv6 is available.

2015-10-23 17:06:34 31312 [Note] ??- '::' resolves to '::';

2015-10-23 17:06:34 31312 [Note] Server socket created on IP: '::'.

2015-10-23 17:06:34 31312 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

從報(bào)錯(cuò)上來看吕晌,是由于缺少了mysql.plugin表所致的,不過現(xiàn)在連啟動(dòng)都啟動(dòng)不了临燃,怎樣創(chuàng)建表呢睛驳?所以肯定是其他原因?qū)е碌模跁r(shí)繼續(xù)網(wǎng)上找繼續(xù)試膜廊,最后找到了這個(gè)處理方法乏沸,進(jìn)入mysql安裝后的目錄scripts執(zhí)行以下語句:

[root@localhost scripts]# ./mysql_install_db --user=mysql --basedir=/home/mysql5627 --datadir=/usr/mysqldata

Installing MySQL system tables...2015-10-23 17:47:57 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2015-10-23 17:47:57 0 [Note] /home/mysql5627/bin/mysqld (mysqld 5.6.27) starting as process 31756 ...

2015-10-23 17:47:57 31756 [Note] InnoDB: Using atomics to ref count buffer pool pages

2015-10-23 17:47:57 31756 [Note] InnoDB: The InnoDB memory heap is disabled

2015-10-23 17:47:57 31756 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2015-10-23 17:47:57 31756 [Note] InnoDB: Memory barrier is not used

2015-10-23 17:47:57 31756 [Note] InnoDB: Compressed tables use zlib 1.2.3

2015-10-23 17:47:57 31756 [Note] InnoDB: Using CPU crc32 instructions

2015-10-23 17:47:57 31756 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2015-10-23 17:47:57 31756 [Note] InnoDB: Completed initialization of buffer pool

2015-10-23 17:47:57 31756 [Note] InnoDB: Highest supported file format is Barracuda.

2015-10-23 17:47:57 31756 [Note] InnoDB: Log scan progressed past the checkpoint lsn 49463

2015-10-23 17:47:57 31756 [Note] InnoDB: Database was not shutdown normally!

2015-10-23 17:47:57 31756 [Note] InnoDB: Starting crash recovery.

2015-10-23 17:47:57 31756 [Note] InnoDB: Reading tablespace information from the .ibd files...

2015-10-23 17:47:57 31756 [Note] InnoDB: Restoring possible half-written data pages?

2015-10-23 17:47:57 31756 [Note] InnoDB: from the doublewrite buffer...

InnoDB: Doing recovery: scanned up to log sequence number 1600607

2015-10-23 17:47:57 31756 [Note] InnoDB: Starting an apply batch of log records to the database...

InnoDB: Progress in percent: 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99?

InnoDB: Apply batch completed

2015-10-23 17:47:58 31756 [Note] InnoDB: 128 rollback segment(s) are active.

2015-10-23 17:47:58 31756 [Note] InnoDB: Waiting for purge to start

2015-10-23 17:47:58 31756 [Note] InnoDB: 5.6.27 started; log sequence number 1600607

2015-10-23 17:47:58 31756 [Note] Binlog end

2015-10-23 17:47:58 31756 [Note] InnoDB: FTS optimize thread exiting.

2015-10-23 17:47:58 31756 [Note] InnoDB: Starting shutdown...

2015-10-23 17:48:00 31756 [Note] InnoDB: Shutdown completed; log sequence number 1625987

OK

Filling help tables...2015-10-23 17:48:00 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2015-10-23 17:48:00 0 [Note] /home/mysql5627/bin/mysqld (mysqld 5.6.27) starting as process 31780 ...

2015-10-23 17:48:00 31780 [Note] InnoDB: Using atomics to ref count buffer pool pages

2015-10-23 17:48:00 31780 [Note] InnoDB: The InnoDB memory heap is disabled

2015-10-23 17:48:00 31780 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2015-10-23 17:48:00 31780 [Note] InnoDB: Memory barrier is not used

2015-10-23 17:48:00 31780 [Note] InnoDB: Compressed tables use zlib 1.2.3

2015-10-23 17:48:00 31780 [Note] InnoDB: Using CPU crc32 instructions

2015-10-23 17:48:00 31780 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2015-10-23 17:48:00 31780 [Note] InnoDB: Completed initialization of buffer pool

2015-10-23 17:48:00 31780 [Note] InnoDB: Highest supported file format is Barracuda.

2015-10-23 17:48:00 31780 [Note] InnoDB: 128 rollback segment(s) are active.

2015-10-23 17:48:00 31780 [Note] InnoDB: Waiting for purge to start

2015-10-23 17:48:00 31780 [Note] InnoDB: 5.6.27 started; log sequence number 1625987

2015-10-23 17:48:00 31780 [Note] Binlog end

2015-10-23 17:48:00 31780 [Note] InnoDB: FTS optimize thread exiting.

2015-10-23 17:48:00 31780 [Note] InnoDB: Starting shutdown...

2015-10-23 17:48:01 31780 [Note] InnoDB: Shutdown completed; log sequence number 1625997

OK

To start mysqld at boot time you have to copy

support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:

??/home/mysql5627/bin/mysqladmin -u root password 'new-password'

??/home/mysql5627/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

Alternatively you can run:

??/home/mysql5627/bin/mysql_secure_installation

which will also give you the option of removing the test

databases and anonymous user created by default. ?This is

strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

??cd . ; /home/mysql5627/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

??cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

??http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

WARNING: Found existing config file /home/mysql5627/my.cnf on the system.

Because this file might be in use, it was not replaced,

but was used in bootstrap (unless you used --defaults-file)

and when you later start the server.

The new default config file was created as /home/mysql5627/my-new.cnf,

please compare it with your file and take the changes you need.

WARNING: Default config file /etc/my.cnf exists on the system

This file will be read by default by the MySQL server

If you do not want to use this, either remove it, or use the

--defaults-file argument to mysqld_safe when starting the server

然后再運(yùn)行./mysqld就成功了。

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末爪瓜,一起剝皮案震驚了整個(gè)濱河市蹬跃,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌铆铆,老刑警劉巖蝶缀,帶你破解...
    沈念sama閱讀 218,546評(píng)論 6 507
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異薄货,居然都是意外死亡扼劈,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,224評(píng)論 3 395
  • 文/潘曉璐 我一進(jìn)店門菲驴,熙熙樓的掌柜王于貴愁眉苦臉地迎上來荐吵,“玉大人,你說我怎么就攤上這事赊瞬∠燃澹” “怎么了?”我有些...
    開封第一講書人閱讀 164,911評(píng)論 0 354
  • 文/不壞的土叔 我叫張陵巧涧,是天一觀的道長(zhǎng)薯蝎。 經(jīng)常有香客問我,道長(zhǎng)谤绳,這世上最難降的妖魔是什么占锯? 我笑而不...
    開封第一講書人閱讀 58,737評(píng)論 1 294
  • 正文 為了忘掉前任袒哥,我火速辦了婚禮,結(jié)果婚禮上消略,老公的妹妹穿的比我還像新娘堡称。我一直安慰自己,他們只是感情好艺演,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,753評(píng)論 6 392
  • 文/花漫 我一把揭開白布却紧。 她就那樣靜靜地躺著,像睡著了一般胎撤。 火紅的嫁衣襯著肌膚如雪晓殊。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,598評(píng)論 1 305
  • 那天伤提,我揣著相機(jī)與錄音巫俺,去河邊找鬼。 笑死肿男,一個(gè)胖子當(dāng)著我的面吹牛介汹,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播次伶,決...
    沈念sama閱讀 40,338評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼痴昧,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼稽穆!你這毒婦竟也來了冠王?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 39,249評(píng)論 0 276
  • 序言:老撾萬榮一對(duì)情侶失蹤舌镶,失蹤者是張志新(化名)和其女友劉穎柱彻,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體餐胀,經(jīng)...
    沈念sama閱讀 45,696評(píng)論 1 314
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡哟楷,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,888評(píng)論 3 336
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了否灾。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片卖擅。...
    茶點(diǎn)故事閱讀 40,013評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖墨技,靈堂內(nèi)的尸體忽然破棺而出惩阶,到底是詐尸還是另有隱情,我是刑警寧澤扣汪,帶...
    沈念sama閱讀 35,731評(píng)論 5 346
  • 正文 年R本政府宣布断楷,位于F島的核電站,受9級(jí)特大地震影響崭别,放射性物質(zhì)發(fā)生泄漏冬筒。R本人自食惡果不足惜恐锣,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,348評(píng)論 3 330
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望舞痰。 院中可真熱鬧土榴,春花似錦、人聲如沸匀奏。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,929評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽娃善。三九已至论衍,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間聚磺,已是汗流浹背坯台。 一陣腳步聲響...
    開封第一講書人閱讀 33,048評(píng)論 1 270
  • 我被黑心中介騙來泰國(guó)打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留瘫寝,地道東北人蜒蕾。 一個(gè)月前我還...
    沈念sama閱讀 48,203評(píng)論 3 370
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像焕阿,于是被迫代替她去往敵國(guó)和親咪啡。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,960評(píng)論 2 355

推薦閱讀更多精彩內(nèi)容