Chosen names are as follows:
Database | p08_xxyyzz |
---|---|
User | up08xxyyzz |
Password | 4PJmbVu6SdeySyW |
DROP DATABASE p08_xxyyzz; CREATE DATABASE p08_xxyyzz;
DROP USER 'up08xxyyzz'@'localhost'; CREATE USER 'up08xxyyzz'@'localhost' IDENTIFIED BY '4PJmbVu6SdeySyW'; GRANT USAGE ON * . * TO 'up08xxyyzz'@'localhost' IDENTIFIED BY '4PJmbVu6SdeySyW' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ; GRANT ALL PRIVILEGES ON `p08_xxyyzz` . * TO 'up08xxyyzz'@'localhost' WITH GRANT OPTION ;
DROP USER 'up08xxyyzz'@'%'; CREATE USER 'up08xxyyzz'@'%' IDENTIFIED BY '4PJmbVu6SdeySyW'; GRANT USAGE ON * . * TO 'up08xxyyzz'@'%' IDENTIFIED BY '4PJmbVu6SdeySyW' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ; GRANT ALL PRIVILEGES ON `p08_xxyyzz` . * TO 'up08xxyyzz'@'%' WITH GRANT OPTION ;
This is to create a 'secondary' root user with access from a different host (or all hosts). Login as mysql root user:
SELECT Host,USER,Grant_priv,Super_priv FROM USER ORDER BY USER, Host; CREATE USER 'root'@'%' IDENTIFIED BY 'somemypassword'; GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES;
To drop:
DROP USER 'root'@'%';
Test login
mysql -hremotehost -uroot -psomemypassword mysql