1. 程式人生 > >MySQL [ERROR] Table 'mysql.user' doesn't exist

MySQL [ERROR] Table 'mysql.user' doesn't exist

    一次原始碼新裝的mysql,由於沒有複製my-default.cnf到/etc/my.cnf位置,在啟動mysql的時候碰到了無法開啟mysql.user表的錯誤。具體錯誤為:[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist。下面是該錯誤的描述及其解決辦法。

1、現象描述
[[email protected] scripts]# service mysqld start
Starting MySQL..The server quit without updating PID file (/var/lib/mysql/HKBO.pid).[FAILED]

#檢視錯誤日誌
[[email protected] scripts]# tail /var/log/mysqld.log
InnoDB: Apply batch completed
2014-12-08 11:01:37 15721 [Note] InnoDB: 128 rollback segment(s) are active.
2014-12-08 11:01:37 15721 [Note] InnoDB: Waiting for purge to start
2014-12-08 11:01:37 15721 [Note] InnoDB: 5.6.12 started; log sequence number 1600607
2014-12-08 11:01:37 15721 [Note] Server hostname (bind-address): '*'; port: 3306
2014-12-08 11:01:37 15721 [Note] IPv6 is available.
2014-12-08 11:01:37 15721 [Note]   - '::' resolves to '::';
2014-12-08 11:01:37 15721 [Note] Server socket created on IP: '::'.
2014-12-08 11:01:37 15721 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
141208 11:01:37 mysqld_safe mysqld from pid file /var/lib/mysql/HKBO.pid ended

2、解決辦法
#檢視當前的my.cnf配置檔案
[[email protected] scripts]# more /etc/my.cnf |grep -v ^#
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
old_passwords=1

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

#由於編譯安裝時指定的路徑為/opt/data以及mysql_install_db時指定的datadir也為/opt/data,而my.cnf為預設的路徑
#因此修改datadir至正確路徑後,問題解決
[

[email protected] scripts]# vi /etc/my.cnf
[[email protected] support-files]# more /etc/my.cnf |grep datadir
datadir=/opt/data

[[email protected] support-files]# service mysqld start
Starting MySQL.[  OK  ]

鵬城DBA總群

相關推薦

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

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

【報錯】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 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 [ERROR] Table 'mysql.user' doesn't exist

    一次原始碼新裝的mysql,由於沒有複製my-default.cnf到/etc/my.cnf位置,在啟動mysql的時候碰到了無法開啟mysql.user表的錯誤。具體錯誤為:[ERROR] F

[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

這個問題是由於data的目錄下沒有安裝資料庫表 解決方法: vi /etc/my.cnf 修改為正確的datadir=“xxxxx”即可 然後service mysqld start service mysql start 正常啟動後,會再/var/lib/mysql下面生

windows下 Mysql 錯誤1067 Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

MySQL服務沒啟動,用命令啟動或者在服務視窗啟動時報錯:發生錯誤1067 然後查了許久各自修改my.ini的放都試了,沒用 開啟錯誤日誌一看,最後一行顯示: [ERROR] Fatal error: Can't open and lock privilege tab

[MySQL]Fatalerror: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

今天在centOS7上安裝mysql5.6後, 無法通過mysql -u root登入, 並且提示 ERROR 2002 (HY000): Can't connect to local MySQL

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

解決方法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到你的專案的目錄下執

【程式碼】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

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

Windows下Mysql解決Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

1.出現原因 mysql資料庫預設位置和自定義安裝位置不同導致 我的電腦上mysql預設安裝位置是 C:\ProgramData\MySQL\MySQL Server 5.7\ 而自定義安裝路徑為 D:\MySQL\MySQL Server 5.5\ 2.解決方法

mysql 提示表不存在的解決方法error: 1146: Table doesn't exist

直接拷貝資料庫導致提示表不存在的解決方法 電腦重灌系統後把原來的mysql data複製進去後大部分表是可以訪問的,但是有幾個表提示表不存在: error: 1146: Table 'a_content' doesn't exist這種情況就是要把原來mysql安裝目錄data裡的 ibdata1 也要拷

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

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