简体   繁体   English

MySQL错误,设置第一个数据库(phpmyadmin,Linux服务器)

[英]MySQL Errors, Setting up first db (phpmyadmin, linux server)

create user 'kai'@'%' identified by password 'mypass'
grant all privileges on *.* to 'kai'@'%' with grant option;  

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'grant all privileges on *.* to 'kai'@'%' with grant option' at line 1

that's one example 那是一个例子

I've tried several different ways including @%, @localhost, etc. My database's name is eve and my site is sdnam.net. 我尝试了几种不同的方式,包括@%,@ localhost等。我的数据库名称为eve,我的站点为sdnam.net。 I tried asking a friend and he said he has cpanel/phpmyadmin in place. 我试图问一个朋友,他说他已经安装了cpanel / phpmyadmin。 I tried setting up phpmyadmin, but it made things more of a headache so I took a step back. 我尝试设置phpmyadmin,但是这让事情更加头疼,所以我退了一步。 i tried going through the mysql guide they have in place, but it didn't help too much. 我试图通过他们已经到位的mysql指南,但并没有太大帮助。 I considered maybe I needed to use @192., etc, but I don't think that'd be secure. 我考虑过也许我需要使用@ 192。等,但是我认为那不是安全的。

Any pointers would be excellent, I'm sure I'm just skipping something easy and I don't know the proper terminology to google or I would have found it already ;). 任何指针都是很好的,我敢肯定,我只是跳过了一些简单的事情,我不知道适用于google的适当术语,否则我已经找到了;)。 This is on Debian 7 64bit, dunno how important that is but everything is updated, etc. 这在Debian 7 64bit上,不知道那是多么重要,但是所有内容都已更新,等等。

Cheers 干杯

Edit: Code above, I've been following this: http://dev.mysql.com/doc/refman/5.5/en/adding-users.html 编辑:上面的代码,我一直在关注此: http : //dev.mysql.com/doc/refman/5.5/en/adding-users.html

and read through ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'db' 并读取错误1044(42000):用户'@'localhost'对数据库'db'的访问被拒绝

priveleges is spelt incorrectly (it should be privileges ). priveleges的拼写错误(应该是privileges )。

UPDATE Also, I think you're trying to do two things at once? 更新另外,我想您正在尝试同时做两件事? create user 'kai'@'%' identified by password 'mypass' grant all priveleges on eve.* to 'kai'@'%' with grant option; is at least two commands.. there should probably be a delimiter after password 'mypass' ? 至少有两个命令.. password 'mypass'后可能应该有一个定界符?

try this 尝试这个

create user 'kai'@'%' identified by password 'mypass' ; <---// you missed semicolon here
grant all privileges on *.* to 'kai'@'%' with grant option; 

check this 检查这个

Correct mysql syntax error when creating a user 创建用户时更正mysql语法错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM