1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| cat /etc/mysql/debian.cnf [client] host = localhost user = debian-sys-maint password = ROmgNW5hP8tsSwrB socket = /var/run/mysqld/mysqld.sock [mysql_upgrade] host = localhost user = debian-sys-maint password = ROmgNW5hP8tsSwrB socket = /var/run/mysqld/mysqld.sock
mysql -udebian-sys-maint -p
use mysql; ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'xxxx';
use mysql; select user,host from user; CREATE DATABASE wordpress; CREATE USER wordpressuser; SET PASSWORD FOR wordpressuser=PASSWORD("password123"); ALTER USER 'wordpressuser'@'%' IDENTIFIED WITH mysql_native_password BY '136140@Techliu';
grant all on wordpress.* to 'wordpressuser'@'%';
FLUSH PRIVILEGES; exit;
|