wamp服务器mysql用户名和密码

发布于 2024-10-07 01:57:09 字数 38 浏览 0 评论 0原文

我安装了wamp,我想知道如何在mysql中创建用户名和密码。

I have wamp installed , I want to know how to create username and password in mysql.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(14

岁吢 2024-10-14 01:57:09

默认情况下,您可以使用用户名:root 和空白密码在 http:// localhost/phpmyadmin 访问数据库。

登录 PHPmyAdmin 后,单击“权限”选项卡。以及位于用户概览表下的添加新用户链接

By default, you can access your databases at http:// localhost/phpmyadmin using user: root and a blank password.

Once logged in PHPmyAdmin, click on the Privileges tab. and on the Add a new user link located under the User Overview table

情定在深秋 2024-10-14 01:57:09

转到 http://localhost/phpmyadmin 并单击“权限”选项卡。有一个“添加新用户”链接。
替代文本

Go to http://localhost/phpmyadmin and click on the Privileges tab. There is a "Add a new user" link.
alt text

沦落红尘 2024-10-14 01:57:09

由于没有密码,请按 Enter 键。输入以下命令:

mysql> SET PASSWORD for 'root'@'localhost' = password('enteryourpassword');
mysql> SET PASSWORD for 'root'@'127.0.0.1' = password('enteryourpassword');
mysql> SET PASSWORD for 'root'@'::1' = password('enteryourpassword');

就是这样,为了简单起见,我保留相同的密码。如果您想检查用户的表以查看信息是否已更新,只需输入如下所示的附加命令。这是一个很好的选择,可以检查您是否确实为所有主机输入了相同的密码。

Hit enter as there is no password. Enter the following commands:

mysql> SET PASSWORD for 'root'@'localhost' = password('enteryourpassword');
mysql> SET PASSWORD for 'root'@'127.0.0.1' = password('enteryourpassword');
mysql> SET PASSWORD for 'root'@'::1' = password('enteryourpassword');

That’s it, I keep the passwords the same to keep things simple. If you want to check the user’s table to see that the info has been updated just enter the additional commands as shown below. This is a good option to check that you have indeed entered the same password for all hosts.

情深已缘浅 2024-10-14 01:57:09

只需转到 MySql 控制台即可。

如果使用 Wamp:

  1. 单击点钟旁边的 Wamp 图标。
  2. 在 MySql 部分中单击 MySql Console。
  3. 按回车键(表示没有密码)两次。
  4. mysql 命令预览如下:mysql>
  5. 设置 'root'@'localhost' 的密码 = PASSWORD('secret');

就是这样。
这会将您的 root 密码设置为机密

为了将用户权限设置为默认权限:

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('');

效果就像一个魅力!

Simply goto MySql Console.

If using Wamp:

  1. Click on Wamp icon just beside o'clock.
  2. In MySql section click on MySql Console.
  3. Press enter (means no password) twice.
  4. mysql commands preview like this : mysql>
  5. SET PASSWORD FOR 'root'@'localhost' = PASSWORD('secret');

That's it.
This set your root password to secret

In order to set user privilege to default one:

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('');

Works like a charm!

风流物 2024-10-14 01:57:09

以前的答案可能不适用于更高版本的 mysql。如果以前的答案对您不起作用,请尝试以下步骤:

  1. 单击 wamp 图标 &rarr:mysql → mysql 控制台

  2. 编写以下内容命令,一一

    使用mysql;
    更新用户集authentication_string=password('your_password'),其中user='root';
    同花顺特权;
    辞职
    

Previous answers might not work for later mysql versions. Try these steps if previous answers did not work for you:

  1. Click on the wamp icon &rarr: mysql → mysql console

  2. write following commands, one by one

    use mysql;
    update user set authentication_string=password('your_password') where user='root';
    FLUSH PRIVILEGES;
    quit
    
我的鱼塘能养鲲 2024-10-14 01:57:09

您可以使用 MySQL 创建一个用户,如下所示:

CREATE USER 'username'@'servername' IDENTIFIED BY 'password';

如果您想针对特定数据库执行此操作,只需在 MySQL 中写入:

GRANT ALL PRIVILEGES ON database_name.*
TO 'username'@'servername'
IDENTIFIED BY 'password';

注意,这都是一句话,还请注意您需要更改:

database_name // your database name
username      // any name you want to use as username
servername    // the name of your server, for example: localhost
password      // any text you want to use as user password

You can create a user using MySQL like this:

CREATE USER 'username'@'servername' IDENTIFIED BY 'password';

and if you want to do that for a specific database, simply you can write in the MySQL:

GRANT ALL PRIVILEGES ON database_name.*
TO 'username'@'servername'
IDENTIFIED BY 'password';

Note that it's all one sentence, also note that you need to change:

database_name // your database name
username      // any name you want to use as username
servername    // the name of your server, for example: localhost
password      // any text you want to use as user password
酸甜透明夹心 2024-10-14 01:57:09

登录 http://localhost/phpmyadmin/ 即可

只需使用用户名:root

密码:

空白密码 。
然后选择用户帐户。然后选择添加用户帐户。

Just login into http://localhost/phpmyadmin/

with username:root

password:

with blank password.
And then choose users account.And then choose add user account.

表情可笑 2024-10-14 01:57:09

WAMP 服务器 – MySQL – 重置 Root 密码 (Windows)

  1. 以管理员身份登录到您的系统。

  2. 点击Wamp服务器图标> MySQL > MySQL 控制台

  3. 输入密码:LEAVE BLANK AND HIT ENTER

  4. mysql> UPDATE mysql.user SET 密码=PASSWORD('MyNewPass') WHERE User='root';进入
    查询OK

  5. mysql>FLUSH PRIVILEGES;进入
    mysql>退出 ENTER
    mysql>再见

  6. 编辑名为“config.inc.php”的 phpmyadmin 文件,输入 'MyNewPass' ($cfg['Servers'][$i]['password'] = 'MyNewPass';)

  7. 重新启动所有服务

  8. < p>清除所有 cookie – 我收到“无密码”错误,这是因为 cookie。 (错误 1045:用户访问被拒绝:“root@localhost”(使用密码:否))

WAMP Server – MySQL – Resetting the Root Password (Windows)

  1. Log on to your system as Administrator.

  2. Click on the Wamp server icon > MySQL > MySQL Console

  3. Enter password: LEAVE BLANK AND HIT ENTER

  4. mysql> UPDATE mysql.user SET Password=PASSWORD(‘MyNewPass’) WHERE User=’root’; ENTER
    Query OK

  5. mysql>FLUSH PRIVILEGES; ENTER
    mysql>quit ENTER
    mysql>bye

  6. Edit phpmyadmin file called “config.inc.php” enter ‘MyNewPass’ ($cfg['Servers'][$i]['password'] = ‘MyNewPass‘;)

  7. Restart all services

  8. Clear all cookies – I got the No password error and it was because of the cookies. (ERROR 1045: Access denied for user: ‘root@localhost’ (Using password: NO))

凡尘雨 2024-10-14 01:57:09

更改或添加 Wamp 服务器的用户名和密码

  1. 转至 phpmyadmn。默认用户名是root,密码为空(空白)
  2. 转到用户帐户选项卡。

如果您看不到该选项卡,请转到 phpmyadmin 的主页,而不选择任何数据库。

  1. 请点击添加用户帐户添加新帐户
  2. 如果您想更改现有帐户的密码, 用户,然后单击 编辑权限 并选择更改密码选项卡

Changing or Adding UserName and Password for Wamp server

  1. Go to phpmyadmn. Default username is root and password is empty (blank)
  2. Go to User accounts tab.

If you cannot see the tab,then go to Home page of phpmyadmin without selecting any DB.

  1. Here click on Add user account to add New Account
  2. If you want to change password for existing users, then click on Edit privileges and select Chanage password Tab
杀手六號 2024-10-14 01:57:09

这里是有关创建新用户帐户的 MySQL 文档。

简而言之,您可以通过运行 CREATE USER 来创建用户 语句:

CREATE USER "<username>" IDENTIFIED BY "<password>";

创建用户后,您可以使用 GRANT 语句

Here is the MySQL documentation on creating new user accounts.

In short, you create a user by running a CREATE USER statement:

CREATE USER "<username>" IDENTIFIED BY "<password>";

Once the user is created, you give him access to do things by using the GRANT statement.

千寻… 2024-10-14 01:57:09

使用http://localhost/sqlbuddy -->用户界面。

您可以在本地主机主页的您的别名部分找到它。

Use http://localhost/sqlbuddy --> users interface.

You can find it at the localhost main page at Your Aliases section.

鸠魁 2024-10-14 01:57:09

转到 phpmyadmin 并单击左侧栏中您已经创建的数据库。然后您可以在顶部看到一个权限选项。您可以在其中添加一个新用户。

如果您还没有任何数据库,请转到 phpmyadmin 并选择数据库,然后只需在字段中提供数据库名称并按“开始”即可创建数据库。

Go to phpmyadmin and click on the database you have already created form the left side bar. Then you can see a privilege option at the top.. There you can add a new user..

If you are not having any database yet go to phpmyadmin and select databases and create a database by simply giving database name in the filed and press go.

做个少女永远怀春 2024-10-14 01:57:09

Darkcoder 的解决方案是唯一适合我的解决方案。 (WAMP 服务器 2.5,其中包括 mysql 5.6.17。+ 客户端是 Workbench 6.3)

为了让任何其他用户(默认 root 除外)能够看到 Workbench 中的架构,我必须为每个附加用户创建 3 次。

Once for host = %
Once for host = localhost
Once for host = ::1

另外,我注意到,为了使授予的权限真正起作用(全局权限和每个数据库权限),我必须确保所有 3 个不同的用户+主机组合的所有权限完全相同。

Darkcoder's solution is the only one that made it work for me. (WAMP server 2.5, which includes mysql 5.6.17. + client is Workbench 6.3)

In order for any additional user (other than the default root) to be able to see the schemas in Workbench, I had to create 3 times each additional user.

Once for host = %
Once for host = localhost
Once for host = ::1

Also, I noticed that in order for the granted privileges to really work (global and per database ones), I had to make sure all privileges were exactly the same for all the 3 different user+host combinations.

〆凄凉。 2024-10-14 01:57:09

我尝试使用用户名“admin”登录,它让我进入,但没有任何权限,我不知道这一点。然后我尝试使用用户名“root”,然后我拥有了权限,因此我将权限更改为其他用户。这两个用户名都不使用密码,因此我将其留空。

I was trying to log in with the username "admin" and it let me got in, but without any privileges and I did not know that. Then I tried with the username "root", and then I had privileges so I changed the privileges to the other users. Both usernames do not use passwords, so I leave them blank.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文