7.x 格式
CREATE DATABASE `wangzy`;
GRANT ALL PRIVILEGES ON *.* TO 'wangzy'@'%' IDENTIFIED BY 'asr_2w4r123' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'wangzy'@'192.168.43.12' IDENTIFIED BY 'asr_2w4r123' WITH GRANT OPTION;
flush privileges;
use wangzy;
8.x 格式
CREATE DATABASE `wangzy`;
CREATE USER 'wangzy'@'%' IDENTIFIED BY '1q2w3e';
GRANT ALL PRIVILEGES ON *.* TO 'wangzy'@'%';
FLUSH PRIVILEGES;
use wangzy;
说明:本博客所有内容仅用于学习参考,具体需根据实际环境为主