1. 程式人生 > >mysql無法啟動(Table 'mysql.plugin' doesn't exist)

mysql無法啟動(Table 'mysql.plugin' doesn't exist)

151226 17:49:20 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
/usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist
151226 17:49:20 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
151226 17:49:20  InnoDB: Initializing buffer pool, size = 8.0M
151226 17
:49:20 InnoDB: Completed initialization of buffer pool InnoDB: Log scan progressed past the checkpoint lsn 0 37356 151226 17:49:20 InnoDB: Database was not shut down normally! InnoDB: Starting crash recovery. InnoDB: Reading tablespace information from the .ibd files... InnoDB: Restoring possible half-written data pages from
the doublewrite InnoDB: buffer... InnoDB: Doing recovery: scanned up to log sequence number 0 44233 151226 17:49:20 InnoDB: Starting an apply batch of log records to the database... InnoDB: Progress in percents: 45 46 47 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 151226 17:49:21 InnoDB: Started; log sequence number 0 44233 151226 17:49:21 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 151226 17:49:21 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

因為/etc/my.cnf
裡面設定字符集的時候順手寫了個utf-8,然後初始化資料庫的時候就報錯了。utf-8之間的一橫是不能加的。加了之後就不對了,提示這個

151226 17:45:28 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
^G/usr/libexec/mysqld: Character set 'utf-8' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file
151226 17:45:28 [ERROR] Aborting

151226 17:45:28 [Note] /usr/libexec/mysqld: Shutdown complete

151226 17:45:28 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

然後就只有刪除資料庫了

rm -rf /var/lib/mysql

很不巧的是我cd到了/var/lib/mysql
然後重啟的時候

[root@xuegod83 mysql]# service mysqld restart
shell-init: error retrieving current directory: getcwd: cannot access parent directories: 沒有那個檔案或目錄
chdir: error retrieving current directory: getcwd: cannot access parent directories: 沒有那個檔案或目錄
停止 mysqld:                                              [確定]
正在啟動 mysqld:                                          [確定]

就提示了這個錯誤,以為是mysql配置檔案哪裡寫錯了。查了下才知道因為把/var/lib/mysql 刪除了,導致當前所在位置已經不存在了。刪除這個資料夾也是為了解決那個初始化的時候的錯誤。之前看這個資料夾是有東西,刪除了之後重新的時候的時候沒報錯,但這個資料夾也沒生成東西了,不知道會不會出問題。

緊著著連線資料庫的時候就報錯了

[root@xuegod83 ~]# mysql -uroot -pwangjun1009
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

我就手動建立了原來刪除的/var/lib/mysql 然後改許可權

[root@xuegod83 ~]# mkdir /var/lib/mysql
[root@xuegod83 ~]# chown mysql:mysql -R /var/lib/mysql/ 

然後重啟服務

[[email protected] ~]# service mysqld restart
停止 mysqld:                                              [確定]
初始化 MySQL 資料庫: WARNING: The host 'xuegod83' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
OK
Filling help tables...
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:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h xuegod83 password 'new-password'

Alternatively you can run:
/usr/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 /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

                                                           [確定]
正在啟動 mysqld:                                          [確定]

不出所料,這才是初始化了資料庫

[[email protected] ~]# ll /var/lib/mysql/
總用量 20488
-rw-rw---- 1 mysql mysql 10485760 1226 18:06 ibdata1
-rw-rw---- 1 mysql mysql  5242880 1226 18:06 ib_logfile0
-rw-rw---- 1 mysql mysql  5242880 1226 18:06 ib_logfile1
drwx------ 2 mysql mysql     4096 12月 26 18:06 mysql
srwxrwxrwx 1 mysql mysql        0 12月 26 18:06 mysql.sock
drwx------ 2 mysql mysql     4096 12月 26 18:06 test

相關推薦

mysql無法啟動(Table 'mysql.plugin' doesn't exist)

151226 17:49:20 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql /usr/libexec/mysqld: Table 'mysql.plugin' doe

Linux CentOS 啟動mysql提示錯誤:Table 'mysql.plugin' doesn't exist

CentOS 啟動mysql提示錯誤:Table 'mysql.plugin' doesn't exist 在linux CentOS下啟動mysql時發現表mysql.plugin不存在,不合理啊

裝完mysql啟動報錯:“Tablemysql.plugindoesnt exist” 解決方法

裝完mysql後啟動mysql發現啟動不了,錯誤日誌裡面會提示Table ‘mysql.plugin’ doesn’t exist,出現此錯誤的原因有兩種。 一種是裝完mysql之後沒有執行初始化mysql系統資料庫的指令碼,如果是這種情況,要先做指令碼的初始化,方法如

解決方法Table 'performance_schema.session_variables' doesn't exist

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. T

SpringBoot : Springboot-jpa Table 'sell.hibernate_sequence' doesn't exist

解決辦法一:加上 @GeneratedValue(strategy = GenerationType.IDENTITY) 像下面這樣: @GeneratedValue(strategy = Gen

錯誤程式碼: 1146 Table 'test.triggers' doesn't exist

1、錯誤描述1 queries executed, 0 success, 1 errors, 0 warnings 查詢:desc triggers 錯誤程式碼: 1146 Table 'test.

django報錯ProgrammingError at /register/ (1146, "Table 'gitnote.loginapp_user' doesn't exist")

ProgrammingError at /register/(1146, "Table 'gitnote.loginapp_user' doesn't exist")這個錯誤是指沒有名字叫這個的表存在,錯誤也就是你沒有執行遷移命令生成並執行遷移檔案可以cd到你的專案的目錄下執

ERROR 1146 (42S02): Table 'performance_schema.session_variables' doesn't exist

之前mysql升級後使用show variables出現該錯誤,需要進行mysql_upgrade操作進行修復。 1)首先退出mysql 2)在命令列介面輸入: mysql_upgrade -uroot -p --force 3)然後重啟mysql即可 windows

Database ERROR:Table 'snort.acid_ag' doesn't exist

8、Database ERROR:Table'snort.acid_ag' doesn't exist 輸入密碼,然後執行以下命令 Use snort                                    //進入該資料庫,後再執行下面的的命令 mys

【程式碼】thinkphp檢視模型查詢失敗提示:ERR: 1146:Table ‘db.pr_order_view’ doesnt exist

想用thinkphp的檢視模型進行關聯查詢,結果出現了這樣兒的問題(log日誌記錄):ERR: 1146:Table 'db.pr_order_view' doesn't exist,我就納悶兒,檢視模型怎麼出來的sql是這樣兒的呢,檢視模型如下: /**   * 訂單

10020---hibernate---Table 'XXX.XXX' doesn't exist

在設定自動生成資料表的策略中: <!-- 自動生成資料表的策略 --> <property name="hbm2ddl.auto">update</property>//別的值也可以 但是出現了一個問題:Table

Table 'test._t_tablename_new' doesn't exist

往表裡插入一條資料: mysql> insert into t_message(MSG_ID) values('1'); ERROR 1146 (42S02): Table 'test._t_message' doesn't exist 提示的是_

【Hibernate】Table '表名' doesn't exist

1. <property name="hbm2ddl.auto">create</property> 被註釋掉,或者中間不是create2.表中有關鍵字,如:order,level,address,degree等。 3.將 <propert

【報錯】BatchUpdateException: Table 'right_test_db.user' doesn't exist

log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. Tue Jun 28 14:2

處理mysql啟動報錯Table 'mysql.plugin' doesn't exis

Installing MySQL system tables...2015-10-23 17:47:57 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_ti

mysql啟動(Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

啟動 mysql 服務的時候報如下錯誤: Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 解決方法: mysql_install_db --user=my

MySQL主從報錯解決:Tablemysql.gtid_slave_pos’ doesnt exist

給內部一個數據庫做異地熱備,熱備部分採用了 MariaDB 的 galera 叢集模式。然後挑選其中一臺作為 Slave 和深圳主叢集做主從同步。 主叢集是老環境,用的版本還是是 MySQL 5.5.13。用常規辦法建立主從同步 MariaDB [(none)]

MySQL ERROR Table 'mysql user' doesn't exist

#檢視錯誤日誌[[email protected] scripts]# tail /var/log/mysqld.logInnoDB: Apply batch completed2014-12-08 11:01:37 15721 [Note] InnoDB: 128 rollback segment

MYSQL服務無法啟動:InnoDB: .\ibdata1 can't be opened in read-write mode

今天在那做實驗倒騰mysql資料庫,後來發現服務無法啟動,檢視日誌報錯如下: 2015-01-07 17:48:54 9136 [ERROR] InnoDB: .\ibdata1 can't be opened in read-write mode 2015-01-07

mysql 直接從date 資料夾備份表,還原資料庫之後提示 table doesn`t exist的原因和解決方法

如型別是MyISAM, 資料檔案則以”Table.frm””Table.MYD””Table.MYI””三個檔案儲存於”/data/$databasename/”目錄中.如型別是InnoDB, 資料檔案則儲存在”$innodb_data_home_dir/″中的ibdat