Table 'mysql.user' doesn't exist:ERROR

后端 未结 8 1628
不知归路
不知归路 2020-12-13 14:58

I am creating a db in mysql for a java program.My program works well in my friends system.But I have some problem with my mysql.

The query is below:

         


        
相关标签:
8条回答
  • 2020-12-13 15:13

    My solution was to run

    mysql_upgrade -u root
    

    Scenario: I updated the MySQL version on my Mac with 'homebrew upgrade'. Afterwards, some stuff worked, but other commands raised the error described in the question.

    0 讨论(0)
  • 2020-12-13 15:13

    You can run the following query to check for the existance of the user table.

    SELECT * FROM information_schema.TABLES
    WHERE TABLE_NAME LIKE '%user%'
    

    See if you can find a row with the following values in

    mysql   user    BASE TABLE  MyISAM  
    

    If you cant find this table look at the following link to rebuild the database How to recover/recreate mysql's default 'mysql' database

    0 讨论(0)
  • 2020-12-13 15:16

    Try run mysqladmin reload, which is located in /usr/loca/mysql/bin/ on mac.

    0 讨论(0)
  • 2020-12-13 15:21

    Your database may be corrupt. Try to check if mysql.user exists:

    use mysql;
    select * from user;
    

    If these are missing you can try recreating the tables by using

    mysql_install_db

    or you may have to clean (completely remove it) and reinstall MySQL.

    0 讨论(0)
  • 2020-12-13 15:26

    Looks like something is messed up with your MySQL installation. The mysql.user table should definitely exist. Try running the command below on your server to create the tables in the database called mysql:

    mysql_install_db
    

    If that doesn't work, maybe the permissions on your MySQL data directory are messed up. Look at a "known good" installation as a reference for what the permissions should be.

    You could also try re-installing MySQL completely.

    0 讨论(0)
  • 2020-12-13 15:28
    'Error Code: 1046'. 
    

    This error shows that the table does not exist may sometimes be caused by having selected a different database and running a query referring to another table. The results indicates 'No database selected Select the default DB to be used by double-clicking its name in the SCHEMAS list in the sidebar'. Will solve the issue and it worked for me very well.

    0 讨论(0)
提交回复
热议问题