Enter current password for root (enter for none): =======>'输入数据库root密码 第一次初始化不用输入'
OK, successfully used password, moving on...
Set root password? [Y/n] y =======>'是否设置root密码'
New password: =======>'设置root密码'
Re-enter new password: =======>'设置root密码'
Password updated successfully!
Reloading privilege tables..
Remove anonymous users? [Y/n] y =======>'是否移除匿名用户'... Success!
Disallow root login remotely? [Y/n] y =======>'拒绝root远程登录'... Success!
Remove test database and access to it? [Y/n] y =======>'删除temp数据库'
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reload privilege tables now? [Y/n] y =======>'重载权限'... Success!
# 创建数据库CREATEDATABASE 数据库名 CHARACTERSET utf8mb4;# 创建用户 CREATEUSER'用户名'@'%' IDENTIFIED BY '密码';
# 授权用户管理数据库
GRANT ALL PRIVILEGES ON 数据库名.* TO '用户名'@'%';# 数据刷新
FLUSH PRIVILEGES;# 退出EXIT;