Skip to main content

DB's and Users

Create a DB
 
 
 
Drop a DB
 
 
 
Create a new user with all prems
 
 
 

GRANT [type of permission] ON [database name].[table name] TO ‘[username]’@'localhost’;

REVOKE [type of permission] ON [database name].[table name] FROM ‘[username]’@‘localhost’;

 
 
 
 
 
 
Add user to 1 DB
 
 
 
To drop a user:
 
 
 

Innodb recovery

What we will need to do for the recovery is to stop mysql and put it in innodb_force_recovery to attempt to backup all databases.

 
 
 

You can start from 1 to 4, go up if it does not start and check mysql logs if it keeps crashing.

innodb_force_recovery = 1

 
 
 

Drop all databases that needs recovery.

 
 
 

Comment out innodb_force_recovery in /etc/my.cnf

 
 
 
  

Then check /var/lib/mysql/server/hostname.com.err to see if it creates new ib's.
Then you can restore databases from the dump:mysql < dump.sql