Urgent mysql stopped working after importing a database

azadhussnain

Well-Known Member
May 28, 2020
62
0
6
India
cPanel Access Level
Root Administrator
Hello, i have imported an database via this command :
mysql -u root < all_databases.sql

after it, everything stopped working. WHM >> phpmyadmin this is also not working. cPanel's phpmyadmin also not working.
mysql server is offline.

in whm >> phpmyadmin i am getting this error :
mysqli_connect(): (28000/1045): Access denied for user 'root'@'localhost' (using password: YES)
Undefined index: auth_type

i tried changing password of users and root and mysql root but nothing works.

please help me fast
 
Last edited by a moderator:

andrew.n

Well-Known Member
Jun 9, 2020
918
342
63
EU
cPanel Access Level
Root Administrator
You seems to be overwrote everything with whatever in all_databases.sql was. If this is only one database you would need to restore it with:

mysql -u username -p databasename < all_databases.sql

Now in your case the best would be to restore the databases from backups.
 
  • Like
Reactions: cPRex

azadhussnain

Well-Known Member
May 28, 2020
62
0
6
India
cPanel Access Level
Root Administrator
Yes you're right, actually i lost everything. Everything is corrupted.
Now i restored everything and now working fine.

Actually the file all_databases.sql contains 3-4 databases like
datab_1
datab_2
datab_3

I talked with a guy he said it is not possible to restore all these databases from this file via a single command you have to restore every database one by one
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
11,743
1,868
363
cPanel Access Level
Root Administrator
If you have the all_databases.sql file and would like to restore using that, the following command will let you restore one database using the all_databases file:

Code:
mysql --one-database database_name < all_databases.sql