CREATE 'exporter'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY 'yoursecretpassword'语法正确吗
时间: 2023-12-17 20:02:43 浏览: 23
不太正确,正确的语法是:
```
CREATE USER 'exporter'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY 'yoursecretpassword';
```
这将创建一个名为'exporter'的用户,可以从本地(即127.0.0.1)访问,并使用mysql_native_password作为认证插件,密码为"yoursecretpassword"。请注意,'CREATE USER'语句应该以'USER'而不是'CREATE'开头。
相关问题
You need to run mysqld with --default_authentication_plugin=mysql_native_password and create user for mysqld_exporter: CREATE 'exporter'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY 'yoursecretpassword';什么意思
这句话是关于mysqld_exporter的安装和配置的说明。
第一部分 "--default_authentication_plugin=mysql_native_password" 是指在运行mysqld服务时,需要使用mysql_native_password作为默认的用户认证插件。
第二部分 "CREATE 'exporter'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY 'yoursecretpassword';" 是创建mysqld_exporter的用户,该用户的名称为'exporter',可以从本地(即127.0.0.1)访问,并且使用mysql_native_password作为认证插件,密码为"yoursecretpassword"。
这些步骤是为了确保mysqld_exporter能够正常连接到MySQL数据库,并且具有足够的权限来收集和导出指标数据。
You need to run mysqld with --default_authentication_plugin=mysql_native_password and create user for mysqld_exporter: CREATE 'exporter'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY 'yoursecretpassword';什么意思
这段话是关于 MySQL 数据库的操作指令。其中,`mysqld_exporter` 是一个监控 MySQL 数据库的工具,需要一个对应的用户来进行访问。`--default_authentication_plugin=mysql_native_password` 是指定了该用户的认证插件为 `mysql_native_password`,这是 MySQL 8.0 后的默认认证插件。接下来的 `CREATE 'exporter'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY 'yoursecretpassword';` 则是创建了一个名为 `exporter`,IP 地址为 `127.0.0.1` 的用户,并设置其密码为 `yoursecretpassword`。这个用户可以被用来进行 `mysqld_exporter` 的访问。