# mysql -u root -p create database example; create user 'example'@'%' identified by 'strongpassword'; grant all privileges on example.* to 'example'@'%'; UPDATE mysql.user SET Super_Priv='Y' WHERE user='example' AND host='%'; flush privileges;
To change password from command line:
$ mysql -u root -p SHOW VARIABLES LIKE "%version%"; SELECT user, host FROM mysql.user; --for 5.7.6 or newer ALTER USER 'username'@'hostname' IDENTIFIED BY 'newpassword'; --for 5.7.5 or older SET PASSWORD FOR 'username'@'hostname' = PASSWORD('newpassword'); FLUSH PRIVILEGES;