I'm using MySQL 5.5.16 noinstall Zip Archive on Win7.

我在Win7上使用MySQL 5.5.16 noinstall Zip Archive。

After I started the server, the command show databases showed me a list of 2 databases: information_schema and test. The latter is empty.

启动服务器后,命令show databases向我显示了2个数据库的列表:information_schema和test。后者是空的。

Where is the table user?

表用户在哪里?

I tried to create a new user through this command create user newUser; and got the following error message: ERROR 1227 (42000): Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation

我尝试通过这个命令创建一个新用户create user newUser;并收到以下错误消息:错误1227(42000):访问被拒绝;您需要(至少一个)此操作的CREATE USER权限

What should I do to create, databases, tables, and do all the operations I want to do? I don't know if the fact that I'm using MySQL 5.5.16 noinstall Zip Archive has something to do with the error message?

我该怎么做才能创建,数据库,表格,并做我想做的所有操作?我不知道我使用MySQL 5.5.16 noinstall Zip Archive的事实是否与错误消息有关?

1 个解决方案

#1


84

First thing to do is run this:

首先要做的是运行:

SHOW GRANTS;

You will quickly see you were assigned the anonymous user to authenticate into mysql.

您很快就会看到您被分配了匿名用户来验证mysql。

Instead of logging into mysql with

而不是登录到mysql

mysql

login like this:

像这样登录:

mysql -uroot

By default, root@localhost has all rights and no password.

默认情况下,root @ localhost拥有所有权限,没有密码。

If you cannot login as root without a password, do the following:

如果您无法在没有密码的情况下以root身份登录,请执行以下操作:

Step 01) Add the two options in the mysqld section of my.ini:

步骤01)在my.ini的mysqld部分添加两个选项:

[mysqld]
skip-grant-tables
skip-networking

Step 02) Restart mysql

步骤02)重启mysql

net stop mysql
<wait 10 seconds>
net start mysql

Step 03) Connect to mysql

步骤03)连接到mysql

mysql

Step 04) Create a password from root@localhost

步骤04)从root @ localhost创建密码

UPDATE mysql.user SET password=password('whateverpasswordyoulike')
WHERE user='root' AND host='localhost';
exit

Step 05) Restart mysql

步骤05)重启mysql

net stop mysql
<wait 10 seconds>
net start mysql

Step 06) Login as root with password

步骤06)以root身份登录密码

mysql -u root -p

You should be good from there.

你应该从那里做起。

CAVEAT: Please remove anonymous users !!!

CAVEAT:请删除匿名用户!

更多相关文章

  1. Linux下修改MySQL用户(root)密码
  2. mysql忘记帐号密码 解决办法。
  3. CentOS使用MySQL的详细步骤,及C API编程
  4. XAMPP附带的mysql如何修改密码
  5. linux CentOS 7.4下 mysql5.7.20 密码改简单的方法
  6. navicat for mysql 连接报错1251详细解决步骤
  7. MySQLWorkbench 创建E-R图步骤
  8. MySQL手动安装步骤
  9. centos设置mysql root密码

随机推荐

  1. 谷歌横幅广告未能加载广告:0
  2. 9PNG用的很不舒服,请高手指导!
  3. Android-----------扫描二维码
  4. Android 开发之 Android 开发的起步
  5. Android控件组合应用四
  6. [MD]模仿百度手机助手动态折线图/MPAndro
  7. Android圆弧形ListView的实现
  8. Android在Dialog中显示PopupWindow不全问
  9. sc7731 Android 5.1 Camera 学习之二 fra
  10. 跟随屏幕大小自动调整bitmap大小(横竖屏拍