'information_schema.character_sets' doesn't exist - mysql

I have installed WAMP server2.2 . Installation completed smoothly. but when i tried to access phpmyadmin. It gives error. I changed the password from /wamp/apps/phpmyadmin3.5.1/conf.inc.php.
But now I am facing another error as follows:
Error:-
SQL query: Documentation Edit
SELECT * FROM information_schema.CHARACTER_SETS
MySQL said: Documentation
#1146 - Table 'information_schema.character_sets' doesn't exist
I am new to this so please help me out....I stuck on the same error......
I can't proceed further without phpmyadmin..... Hope somebody help me as early as possible to resolve this error.
Thanks in advance.

Login via command line,
mysql -h myhost -u myusername -p
<ENTER PASSWORD>
run the command
show databases;
sample output:
+--------------------+
| Database |
+--------------------+
| mysql |
| phprojekt |
| test |
+--------------------+
if there is no database information_schema in your output , your mysql server is too old. (Version 4.x, most recent is 5.6 as of 2013). This can be the case, if you try to connect to an old database server in your company which didn't bother to upgrade (happens quite often for many reasons).
Also read this:
Generate INFORMATION_SCHEMA table for MySQL database
(you can't)

Related

Importing mysql5.8 dump into mariadb 10.5 does not let me use already created users

I've a very fresh installation of mariadb-server-10.5 (1:10.5.15-0+deb11u1) on a freshly installed debian 11.1 .
On the old machine with mysql-server (5.5.9999+default) and debian 9.6 I created a dump like this:
mysqldump -u root -pSOMEPW --all-databases > all_databases.dump
and I loaded this dump on the new server:
source /path/to/all_databases.dump
. The source took a while, did not result any error, however it beeped once at the end (no visible error or warning message).
Checking the mysql.user table it has only 3 entries for root, mysql and mariadb.sys , so I tried to create users (which were existing and used on the old machine) with this command:
create user 'testuser'#'localhost' identified by 'pw';
but it result this error:
ERROR 1396 (HY000): Operation CREATE USER failed for 'testuser'#'localhost'
.
With a short script checking all the tables of the mysql db the 'testuser' appears in 3 different tables, but as a User only in the db table twice like this:
| Host | Db | User | Select_priv
| localhost | somedb | testuser | Y
| localhost | somedbp2 | testuser | Y
.
I think that might cause create user to fail.
How could I fix this issue without losing the information in the db table?
Thanks.
In general you need to run mysql_upgrade whenever you switch to a more recent MySQL or MariaDB release, or after importing a backup taken from an older major version.
This is especially true for MariaDB 10.4 and later when importing from MySQL or from MariaDB 10.3 or earlier, as the internal privilege tables changed substantially with 10.4.
mysql.user table was replaced by mysql.global_priv in 10.4, allowing for more fine grained authentication control, e.g. supporting multiple authentication plugins for a single user.
So now mysql.user is just a VIEW presenting information from mysql.global_priv in a backwards compatible way. Simple information like user and host name can still be modified via that view directly as it is an updateable view, but this does not work for the more complex columns.
And commands like CREATE USER now directly operate on the mysql.global_priv table anyway, the errors you are getting are due to that table not being present in your imported dump.
The good news is: mysql_upgrade will take care of the necessary conversion, and after that CREATE USER should work again.
See also: https://mariadb.com/kb/en/mysql_upgrade/
See also: https://mariadb.com/kb/en/mysqlglobal_priv-table/

MariaDB + Phpmyadmin Migration went wrong. "Not enough privilege to view users."

Old system: Ubuntu 20.04;
New system: Debian 11
What I have done so far:
Dumped MariaDB from the old system with
mysqldump -u root -p --all-databases | gzip > fullbackup.sql.gzip
Imported to the new system with
gunzip < fullbackup.sql.gz | mysql -u root -p
I installed PHPMyAdmin with apt-get install PHPMyAdmin
What are the current problems:
Not all my databases are imported. I can see missing databases after the import.
I have zero ideas how to see all the users in MARIADB
Phpmyadmin is saying, "Not enough privilege to view users".
I tried mysql> select * from mysql.user; REPAIR TABLE user nothing works
What I think got messed up:
The old system version of mariadb is 10.3.32 the new one is 10.5.12
Somehow the users table got messed up forever ERROR 1050 (42S01) at line 56937: Table 'user' already exists
There may be a misconfiguration in the Phpmyadmin I don't know how to fix.
Help me get my new server up and running, please! I am not an advanced user.
Since MySQL 10.4 mysql.users is not a table anymore, but a view into mysql.global_priv table.
It looks like you missed to run mariadb_upgrade. I didn't test if mariadb_upgrade in 10.5 also handles upgrade from 10.3, the usual way is to upgrade each version (10.3 - > 10.4 -> 10.5).

mysql command line can no longer see any databases

I am running a local mysql server to work with some old data from a dump. I am able to normally log into the database using:
/mysql -uroot -p
and in fact the show databases command correctly outputs the following, I am also able to execute queries and use the data normally:
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| servicenow2 |
| sys |
+--------------------+
now the problem is I was using command line to import some files from my old dump:
/mysql -uroot -p servicenow2</filetoimport.sql
however this command no longer works always resulting in (for all dbs in the server):
ERROR 1049 (42000): Unknown database 'servicenow2'
I assume some schema got corrupted somewhere is there any way to fix this so I do not have to dump the db and reimport it the db I am working with is over 150gb and would take a very long time to dump and reimport.
update: I performed a flush privileges as described here : https://superuser.com/questions/603026/mysql-how-to-fix-access-denied-for-user-rootlocalhost
now the command : mysql -uroot -p servicenow2 correctly starts a client in the servicenow2 db but the import mysql -uroot -p servicenow2</filetoimport.sql still gives unknown db error.
Work around in case anyone is interested:
create a new db and import into the new db then move from table in new db to desired db

MYSQL no access/privileges how to change from a useless user to root?

The problem I have is when I get into the commandline for mysql I enter as ''#'localhost' and have no access to anything useful, I'm trying at the moment to get data back to a php page so I need a valid username and password. Is there a way I can create a user account with my feeble resources? Is there a way I can enter the MySQL commandline as root?
Any help appreciated.
If you user is root without any password (like a default MySQL setup), you should be able to connect using:
mysql --user=root
If you need to specify pwd as password:
mysql --user=root -ppwd
Check MySQL command line guide for other details.
When you install MySQL, it asks you to enter credentials for the root user.
If you had not done something like that, I recommend you to reinstall.
Moreover, I would recommend you to use a good package like PHPMyadmin to simplify your operations with databases.
http://www.phpmyadmin.net/home_page/news.php
You could also try Xampp, which has everything in a package - PHP, Tomcat, Mercury , Filezilla, PHPMyadmin and more if you'd like. You will spend almost 0 time configuring anything.
http://www.apachefriends.org/en/xampp.html
Previously, I was getting Access denied... errors for every command, but I was able to resolve the issue after reading RobbieE's suggestion and this documentation:
First, start mysql from the command line as the root user; this is the solution to your original question:
mysql -u root
Now if you'd like to password-protect root...
To see which accounts exist and check their passwords, execute:
SELECT User, Host, Password FROM mysql.user;
You should see an ASCII table, something like this:
+------+--------------------+----------+
| User | Host | Password |
+------+--------------------+----------+
| root | localhost | |
| root | 127.0.0.1 | |
| | localhost | |
+------+--------------------+----------+
Finally, set the password for each root user a la:
SET PASSWORD FOR 'root'#'localhost' = PASSWORD('plaintext-password');
Re-execute statement 2 to verify the password was set correctly. You now have a useful and protected MySQL user for localhost. Do this again for 127.0.0.1 and any other hosts you may have.

Unable to get multiple connection to MySql on Windows 7

I have installed MySql on windows 7 ... issue is i'm unable to get multiple connection to MySql .
If I connect to MySql through command line and at the same time open an other MySql command line client it goes into wait state, as soon as I disconnect the first one later one gets connected.
Because of above issues I'm unable to run tomcat in debug mode as it tries to get more than one connection to MySql in debug mode.
Previously I was using same version of MySql i.e. 5.1 on vista and it was working fine.
when connected with only one MySql Command line "show processlist" results
| 4 | root | localhost:49487 | NULL | Query | 0 | NULL | show processlist
1 row in set (0.00 sec)
and after connnecting with 2nd command line which hangs "show processlist" on the 1st window results
| 4 | root | localhost:49487 | NULL | Query | 0 | NULL | show processlist
| 5 | root | localhost:49518 | NULL | Sleep | 0 | NULL | NULL
2 rows in set (0.00 sec)
I entered following command through command line.
mysql -u root -h localhost -P 3306 -p
it asked me for password and got connected. Then I opened an other command prompt entered the same command it asked for password and hanged. I went back to the previous command line and closed it and the current one got connected. max_connection is 100 in my.ini file and show processlist reutns same result as above.
What is your 'max_connections' setting (show variables like '%max_connections%') and how many connections are currently 'live' on the server (show processlist)?
I'm guessing it's set very low (1 or 2) and between tomcat and your monitor connections you're exceeding the limit.
Raising it would be done via the mysql.ini/mysql.cnf file, wherever it's kept on Windows.
Are you connecting over the network? or a local file socket? You may be locking on the windows equivalent of mysql.sock - not sure if that behavior changed in Win7. Something like:
mysql -u root -h localhost -p 3306
and make sure that my.ini/my.cnf have networking enabled
After too many re installation of Windows I guess i have identified the root cause ... On every fresh installation MySql use to work fine but after a while I use to get stuck with this issue.
The cause was my voip messenger "Wizton" after installing it MySql work fine but when i restart my machine ... same Connection issue.
But wizton was working perfectly fine with Vista Business .. don't no what happens in Windows 7.