Advertisement
Guest User

Untitled

a guest
Feb 3rd, 2016
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. service mysql restart --skip-grant-tables --skip-networking
  2.  
  3. [mysqld]
  4. skip-grant-tables
  5. skip-networking
  6.  
  7. net stop mysql (wait 10 seconds)
  8. net start mysql
  9.  
  10. INSERT INTO mysql.user SET
  11. Host='localhost',
  12. User='mynewuser',
  13. Password=PASSWORD('whateverpassword'),
  14. Select_priv='Y',
  15. Insert_priv='Y',
  16. Update_priv='Y',
  17. Delete_priv='Y',
  18. Create_priv='Y',
  19. Drop_priv='Y',
  20. Reload_priv='Y',
  21. Shutdown_priv='Y',
  22. Process_priv='Y',
  23. File_priv='Y',
  24. Grant_priv='Y',
  25. References_priv='Y',
  26. Index_priv='Y',
  27. Alter_priv='Y',
  28. Show_db_priv='Y',
  29. Super_priv='Y',
  30. Create_tmp_table_priv='Y',
  31. Lock_tables_priv='Y',
  32. Execute_priv='Y',
  33. Repl_slave_priv='Y',
  34. Repl_client_priv='Y';
  35.  
  36. service mysql restart
  37.  
  38. select user,host,password from mysql.user;
  39.  
  40. DELETE FROM mysql.user WHERE ...;
  41. FLUSH PRIVILEGES;
  42.  
  43. desc mysql.user;
  44.  
  45. SELECT CONCAT('SET ... ',GROUP_CONCAT(CONCAT(column_name,'=''Y'''),';'))
  46. FROM information_schema.columns
  47. WHERE table_schema='mysql'
  48. AND table_name='user'
  49. AND column_type='enum(''N'',''Y'')'
  50. ORDER BY ORDINAL_POSITIONG
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement