bash-5.1# bash-5.1# mysql -uroot -pEnter password: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 8Server version: 8.0.38 MySQL Community Server - GPLCopyright (c) 2000, 2024, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> mysql>
复制代码
-)创建数据库
mysql> CREATE DATABASE nacos;
Query OK, 1 row affected (0.00 sec)
复制代码
-)创建用户
# 同时指定密码
CREATE USER 'nacos'@'%' IDENTIFIED BY '#!FlGO****';
复制代码
-)授权
mysql> GRANT ALL PRIVILEGES ON nacos.* TO 'nacos'@'%';