Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mysql issue when creating a new user

( SELECT DISTINCT User
                , Host 
             FROM mysql.user 
) UNION 
( SELECT DISTINCT User
                , Host
             FROM mysql.db 
) UNION 
( SELECT DISTINCT User 
                , Host 
             FROM mysql.tables_priv 
) UNION 
( SELECT DISTINCT User
                , Host 
             FROM mysql.columns_priv 
) UNION 
( SELECT DISTINCT User
                , Host 
             FROM mysql.procs_priv 
) ORDER 
     BY User ASC
      , Host ASC

Mysql said:
`#1030 - Got error 176 "Read page with wrong checksum" from storage engine Aria`

Error here

like image 392
mr.demented Avatar asked Nov 08 '19 11:11

mr.demented


People also ask

How many users can be created in MySQL?

2 Answers. Show activity on this post. MySQL stores its user credentials in a database table, so it's limited by whatever obscene number of rows a MySQL table can hold. These are typically limited by disk space rather than any particular hard limit.

How do I create a new user in MySQL?

Let’s start by making a new user within the MySQL shell: CREATE USER ' newuser ' @ 'localhost' IDENTIFIED BY ' password '; Note: When adding users within the MySQL shell in this tutorial, we will specify the user’s host as localhost and not the server’s IP address. localhost is a hostname which means “this computer,” and MySQL treats this ...

How do I create a user if not exists in MySQL?

CREATE USER IF NOT EXISTS 'user-default'@'localhost' IDENTIFIED BY 'P@ssw0rd' Let’s see the authentication plugin for this user ‘user-default’ in mysql.users table: SELECT host,user,plugin,authentication_string from mysql.user where user='user-default'

How to flush privileges after creating a user in MySQL?

After creating a user and giving all privileges to the user, you need to FLUSH PRIVILEGES to set up and want the new settings to work correctly. Here is the query to create a new user which has the name ‘Bob’ in my case. The query to create a new user is as follows − mysql> GRANT ALL PRIVILEGES ON *.*

What is the difference between Grant and create user in MySQL?

For example, some users are having read access to a specific database, similarly, some can have read-write access to a particular database, etc. CREATE USER command is more frequently used by MySQL Admins to create users for the MySQL Server instances and grant different permissions using the GRANT query.


2 Answers

I also ran into the

"Error: mysqlcheck doesn't support multiple contradicting commands"

issue using the following command

mysqlcheck -u root -p --auto-repair -c -o --all-databases

What I did, and its because I am lazy lol, was run everything separately and used the -r for repair instead of --auto-repair

mysqlcheck -u root -p -r --all-databases
mysqlcheck -u root -p -c --all-databases
mysqlcheck -u root -p -o --all-databases
like image 106
Vlash Avatar answered Oct 12 '22 00:10

Vlash


Don't really know if the cause of the issue is same, but I fixed this issue with mysqlcheck. Run

mysqlcheck -c  -u root -p --all-databases

in terminal (after you run this, you will be prompted for root password if you have set it).

Running this and browsing through the output, I found the issue was with tables_priv table in mysql database. So I repaired it using the -r flag of mysqlcheck.

mysqlcheck -r mysql tables_priv -u root -p

(again, it will prompt for password, enter it). And that fixed it. Don't really know the cause of the issue, but hope this can help anyone else who faces same issue.

You can also run

mysqlcheck -u root -p --auto-repair -c -o --all-databases

to automatically fix all corrupted tables without needing to find which one is corrupted (don't know if this will affect any of your other tables negatively, so try the first option and try this if you fail).

You can get more info about mysqlcheck from here

like image 4
Arun A S Avatar answered Oct 12 '22 00:10

Arun A S