I can't see users in phpmyadmin on windows server 2012. It gives the error:
Not enough privilege to view users.
Warning in .\libraries\classes\Dbi\DbiMysqli.php#213 mysqli_query(): (HY000/1194): Table 'user' is marked as crashed and
should be repaired
How can I resolve this error?
The error, Not enough privilege to view users in phpmyadmin can also occur when importing an older MySQL database into a newer MariaDB instance via a SQL dump due to changes in how the users are stored.
Other symptoms include:
The command select * FROM mysql.user; returns the error message:
ERROR 1356 (HY000): View 'mysql.user' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
The command select * FROM mysql.tables_priv; returns an empty result set.
The solution:
As the database root user, run the following queries:
use mysql;
INSERT INTO `tables_priv` (`Host`, `Db`, `User`, `Table_name`, `Grantor`, `Timestamp`, `Table_priv`, `Column_priv`) VALUES ('localhost','mysql','mariadb.sys','global_priv','root#localhost','0000-00-00 00:00:00','Select,Delete','');
Then restart the MariaDB server.
Credit: IgorG on the Plesk forums. (https://talk.plesk.com/threads/view-mysql-user-references-invalid-table-s-or-column-s-or-function-s-or-definer-invoker-of-view-lack-rights-to-use-them.363334/)
You have to repair your user table. Use a SQL query like 'REPAIR TABLE user' or repair it using phpmyadmin .
Related
MariaDB [(none)]> USE mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [mysql]> UPDATE user SET plugin='mysql_native_password' WHERE User='root';
ERROR 1356 (HY000): View 'mysql.user' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
Please do not try to change system tables that could result in an unusable system. For exact that reason mysql.user table was changed to a read only view years ago.
Changing authentication plugin, password etc. should be done via ALTER USER SQL command.
Error with dropping tables:
SQL query:
DROP user IF EXISTS 's01'#'%';
MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to
use near 'if exists 's01'#'%'' at line 1
Error without dropping tables:
SQL query:
/*Students*/ CREATE User 's01'#'%' IDENTIFIED BY 'pw1';
MySQL said: Documentation
#1396 - Operation CREATE USER failed for 's01'#'%'
Example of some of my code:
Drop user if exists 's01'#'%';
flush privileges;
/*Students*/
Create User 's01'#'%' Identified by 'pw1';
I don't exactly know what is wrong. I looked it up and it said add flush privileges, but I still get the same two errors.
Check your version of mysql with select version();. The IF EXISTS option for DROP USER was added in 5.7. If you're not using 5.7, then that likely explains your first error.
Check if the user exists by querying mysql.user table.
select user, host from mysql.user where user = 's01';
Also since you are not specifying a hostname, just execute
DROP user IF EXISTS 's01';
Create User 's01' Identified by 'pw1';
The wildcard host (#'%') is implied.
Also execute SHOW GRANTS to verify that your user has the correct privileges to create and drop users.
I want to get information from COLUMNS of information_schema. I execute the following command:
root:information_schema> select * from COLUMNS;
but it occur the error:
ERROR 126 (HY000): Incorrect key file for table '/tmp/#sql_11b6_0.MYI'; try to repair it
So I want to repair the table. I execute the following command:
root:information_schema> repair table COLUMNS;
but it occur error again,the wrong content follow:
ERROR 1044 (42000): Access denied for user 'root'#'localhost' to database 'information_schema'
I don't why the root user have no privileges to repair the table
When you see something like '/tmp/#sql_XXXXX_X.MYI', the problem is your file system is full and the temporary file needing to be created can't be written to. Remove any unnecessary files and try again.
I just installed phpmyadmin 4.0.8. Am trying to use it to access 4.1.20 database running on Linux. When I attempt to log into the database server using phpmyadmin, I get this error:
SELECT * FROM information_schema.CHARACTER_SETS
MySQL said:
Documentation
1146 - Table 'information_schema.CHARACTER_SETS' doesn't exist
Tried disabling information_schema in config:
$cfg['Servers'][$i]['DisableIS'] = true;
$cfg['Servers'][$i]['ShowDatabasesCommand'] = 'SHOW DATABASES';
But, get same error. Is there some workaround for this so that I can still use phpmyadmin to manage this database? Any suggestions?
Thanks!
-ron
show databases;
If this command doesnt show information_schema it means your mysql version is old.
I see yours is MySQL version 4,for INFORMATION_SCHEMA you need 5.
I run this command in mysql:
mysql > show databases;
My database called publications is there so I want to use it:
mysql > USE publications
But I get an error:
ERROR 1049 (42000): Unknown database 'publications'
mysql > CREATE DATABASE publications;
ERROR 1007 (HY000): Can't create database 'publications'; database exists
Have I corrupted something? It is on XAMPP on thumb drive. What does this error mean?
you may not have permissions. open up the mysql database, and double check that mysql.db table has the user you are logged in as set up to read, write, etc.. as appropriate. after changing permissions, don't forget to FLUSH PRIVILEGES