gpt4 book ai didi

php - 通过 PHP 添加 MySQL 帐户

转载 作者:行者123 更新时间:2023-12-01 00:14:59 25 4
gpt4 key购买 nike

我正在尝试找到一种使用 php 代码创建带密码的 mysql 用户的方法,即不使用 phpmyadmin、mysql 向导或任何其他工具。

有办法吗?

最佳答案

您可以使用 MySQL 查询来做到这一点:

CREATE USER 'new_username'@'localhost' IDENTIFIED BY 'password_for_new_username';

另见 http://crunchbang.org/archives/2008/04/17/create-mysql-user-accounts-from-the-command-line/

希望对你有帮助。

关于php - 通过 PHP 添加 MySQL 帐户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6244214/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com