How repair corrupt xampp 'mysql.user' table?

前端 未结 7 512
猫巷女王i
猫巷女王i 2020-12-03 04:57

I used Xampp yesterday to create some simple Web-based utility tool. Today I wanted to continue working on it but xampp control panel gave me some weir errors.

This

相关标签:
7条回答
  • 2020-12-03 05:32

    This works for me perfectly

    First Navigate to SQL Queries from your phpmyadmin dashboard

    Copy the below code paste and execute

    repair table DATABASENAME.TABLENAME use_frm;
    
    0 讨论(0)
  • 2020-12-03 05:33

    Step 1. In your XAMPP installation directory find the " \phpMyAdmin\libraries\ "

    Step 2. In above folder, find this file > " check_user_privileges.inc.php "

    Step 3. Open above file in a code editor of your choice and find line number 28
    " $checkUserPrivileges->analyseShowGrant(); "

    Step 4. Delete Line Number 28 and add below code instead:

    $GLOBALS['is_create_db_priv'] = true;
    $GLOBALS['is_reload_priv'] = true;
    $GLOBALS['db_to_create'] = '';
    $GLOBALS['dbs_where_create_table_allowed'] = array('*');
    $GLOBALS['dbs_to_test'] = false;
    $GLOBALS['db_priv'] = true;
    $GLOBALS['col_priv'] = true;
    $GLOBALS['table_priv'] = true;
    $GLOBALS['proc_priv'] = true;
    

    Step 5. Save file and restart XAMPP.

    0 讨论(0)
  • 2020-12-03 05:44

    Use bellow command and you will be happy as i am now.

    repair table DATABASENAME.TABLENAME use_frm;
    

    I'm sure you know that you should change capitals with your storage preferences and backup before runing this command, don't you? :)

    Source: David Malekahmadi

    0 讨论(0)
  • 2020-12-03 05:47

    Just use

    REPAIR TABLE mysql.user
    
    0 讨论(0)
  • 2020-12-03 05:48

    This is almost certainly a known bug in mariaDB (ie mySQL). See ApacheFriends.org for the description. Problem occurs after user password changes - often user root.

    General advice seems to be to cut your losses and downgrade your XAMPP to 7.3.5

    Otherwise the problem may later recur even after a complete uninstall/re-install of 7.3.7 for example.

    What follows is a circumvention / repair for Windows/XAMPP users. It assumes you have a backup - which you probably do. (It appears the installation process provides an initial backup.) Idea is to get you back on air without downgrading long enough for the next release to arrive.

    Quickest way out of the swamp is just to go to step 9.

    (1) Find 'my.ini' (eg. c:\xampp\mysql\bin\my.ini )
    (2) Insert 'skip-grant-tables' in a new line following label '[mysqld]'. Remove this later.
    (3) Now mySQL can be started from the XAMPP control panel.
    (4) Start phpMyAdmin from browser and select table 'user' from database 'mysql'
    (5) Should see: #1034 Index for table 'user' is corrupt; try to repair it.
    (6) Select 'mysql' from left panel then check 'user' in right hand panel.
    (7) From the 'With selected' dropdown run 'analyze' then 'repair table'.
    (8) If 'Repair' fails no choice but to 'DROP TABLE user' ....

    (9) Recreate 'user' table from the distribution backup by copying the following 3 files.

    C:\xampp\mysql\backup\mysql\user.frm 
    C:\xampp\mysql\backup\mysql\user.MYD
    C:\xampp\mysql\backup\mysql\user.MYI
    

    to

    C:\xampp\mysql\data\mysql\
    

    then restarting XAMPP and adding/removing/editing users as you wish.

    One last point: There seems to be some sort of association between the 'user' and 'db' tables. You may need to repair the 'db' table as per step (7).

    0 讨论(0)
  • 2020-12-03 05:51

    I also encountered this 'bozo' error under XAMPP, version 7.3.16, so I'll be sure NOT to upgrade anytime soon. I use SQLYog to manage my database, so I was able to repair the specific table listed in the error -- mysql.db . I don't know what the command line version of this would be, but here is a screenshot of the options I checked in SQLYog:

    0 讨论(0)
自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题