Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
devops:mysql [2020-04-20] – ↷ Page moved from mysql to devops:mysql dcaidevops:mysql [2020-04-20] (current) dcai
Line 1: Line 1:
 +===== mysql =====
  
 +==== Backup ====
 +''mysqldump -u root moodle_32 | xz > ~/Dropbox/moodle_32.sql.xz''
 +
 +==== Display users in long format ====
 +''use mysql; SELECT * FROM user where User="root"\G''
 +==== Create user ====
 +''CREATE USER 'dbuser'@'localhost' IDENTIFIED BY 'mypass';''
 +
 +==== change db owner ====
 +''GRANT ALL PRIVILEGES ON dbname.* TO dbuser@localhost WITH GRANT OPTION;''
 +
 +==== Grant ====
 +''GRANT ALL PRIVILEGES ON `%`.* TO dbuser@'localhost' WITH GRANT OPTION;''
 +
 +''GRANT RELOAD,PROCESS ON *.* TO 'dbuser'@'localhost';''
 +
 +''FLUSH PRIVILEGES;''
 +
 +==== change password ====
 +''SET PASSWORD FOR 'root'@'localhost' = PASSWORD('mypass');''
 +
 +''SHOW WARNINGS'' to see warnings if exists