错误1044拒绝访问数据库 [英] Error 1044 Access denied to database

查看:369
本文介绍了错误1044拒绝访问数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。


我目前正在阅读有关Dreamweaver和使用PHP的书籍。我虽然在设置数据库时遇到了一些麻烦。我的b $ b有php 4.2.3和MySQL 4.0.20a。我在Windows XP Pro上本地运行Apache

1.3.27。


我似乎终于在遇到很多困难之后运行了MySQL。 />
在书中它说要在

mysql>中键入源C:\ mysql \ newland_tours.sql。提示,在我的副本

MySQL中生成newland_tours数据库。


当我这样做时它会给我一条错误信息:


错误1044用户拒绝访问:''@ localhost''到数据库

''newland_tours''


和众多其他人说:


错误1046没有选择数据库


如果你能帮助我,我将非常感激。我认为必须要对

my.ini文件中的文件设置或路径有误或者是错误的吗?或许它只是一个php或MySql的错误?


非常感谢任何帮助


John

Hello.

I am currently working through a book on Dreamweaver and using PHP. I
am having a little trouble with setting up the database though. I
have php 4.2.3 and MySQL 4.0.20a. I am running locally with Apache
1.3.27 on Windows XP Pro.

I seem to have finally got MySQL running after a lot of difficulty.
In the book it says to type source C:\mysql\newland_tours.sql at the
mysql> prompt, to generate the newland_tours database in my copy of
MySQL.

When I do this however it gives me an error message saying:

Error 1044 Access denied for user: ''@localhost'' to database
''newland_tours''

and numerous other ones saying:

Error 1046 No Database Selected

If you can help me I''d be very grateful. I think that something must
be wrong or amiss with the settings or the paths to the files in
my.ini file? Or perhaps it is just a bug with php or MySql?

Thanks very much for any help

John

推荐答案

John写道:
我似乎终于在遇到很多困难后让MySQL运行了。
在书中它说要输入
mysql>源码C:\ mysql \ newland_tours.sql提示,在我的MySQL副本中生成newland_tours数据库。

当我这样做时它会给我一条错误信息:

错误1044访问被拒绝对于用户:''@ localhost''到数据库
''newland_tours''
I seem to have finally got MySQL running after a lot of difficulty.
In the book it says to type source C:\mysql\newland_tours.sql at the
mysql> prompt, to generate the newland_tours database in my copy of
MySQL.

When I do this however it gives me an error message saying:

Error 1044 Access denied for user: ''@localhost'' to database
''newland_tours''




确保在mysql中定义了正确的用户并提供它,例如:


path \to\mysql-installation\bin\mysql -uroot -prootpasswd< newland_tours.sql


有关priveleges的更多信息,请参阅:

http://dev.mysql.com/doc/mysql/en/De...rivileges.html
< a rel =nofollowhref =http://dev.mysql.com/doc/mysql/en/GRANT.html\"target =_ blank> http://dev.mysql.com/doc/mysql/en /GRANT.html

JW



Make sure that the correct user is defined in mysql and supply it, e.g.:

path\to\mysql-installation\bin\mysql -uroot -prootpasswd < newland_tours.sql

For more info on priveleges, see:

http://dev.mysql.com/doc/mysql/en/De...rivileges.html and
http://dev.mysql.com/doc/mysql/en/GRANT.html
JW


2004年6月5日星期六20:59:00 GMT, ; Janwillem Borleffs"

< jw@jwscripts.com>写道:
On Sat, 05 Jun 2004 20:59:00 GMT, "Janwillem Borleffs"
<jw@jwscripts.com> wrote:
John写道:
我似乎终于在遇到很多困难后让MySQL运行了。
在书中它说要输入
mysql>源码C:\ mysql \ newland_tours.sql提示,在我的MySQL副本中生成newland_tours数据库。

当我这样做时它会给我一条错误信息:

错误1044访问被拒绝对于用户:''@ localhost''到数据库
''newland_tours''
确保在mysql中定义了正确的用户并提供它,例如:

path \to\mysql-installation\bin\mysql -uroot -prootpasswd< newland_tours.sql
I seem to have finally got MySQL running after a lot of difficulty.
In the book it says to type source C:\mysql\newland_tours.sql at the
mysql> prompt, to generate the newland_tours database in my copy of
MySQL.

When I do this however it gives me an error message saying:

Error 1044 Access denied for user: ''@localhost'' to database
''newland_tours''

Make sure that the correct user is defined in mysql and supply it, e.g.:

path\to\mysql-installation\bin\mysql -uroot -prootpasswd < newland_tours.sql




我究竟如何定义正确的用户并提供它?


当我转到mysql>提示我输入您输入的内容吗?


path \to\mysql-installation\bin\mysql -uroot -prootpasswd<

newland_tours.sql


我理解这里的一切:path\to\mysql-installation\bin\mysql


但是我对此没有任何线索:-uroot -prootpasswd<

有关priveleges的更多信息,请参阅:

http://dev.mysql.com/doc/mysql/en/De...rivileges.html
http:// dev。 mysql.com/doc/mysql/en/GRANT.html




我看过这些链接以及所有不同的部分和

小节,但对我来说太复杂了。我只是一个初学者。

我需要它解释一下该做什么。


干杯


John



I have taken a look at these links and all the different sections and
subsections, but it is far too complex for me. I am just a beginner.
I need it explained simply what to do.

Cheers

John




" John" < pH值******** @ needshelp.com>在消息中写道

news:gb ******************************** @ 4ax.com ...

"John" <ph********@needshelp.com> wrote in message
news:gb********************************@4ax.com...
2004年6月5日星期六20:59:00 GMT,Janwillem Borleffs
< jw@jwscripts.com>写道:
On Sat, 05 Jun 2004 20:59:00 GMT, "Janwillem Borleffs"
<jw@jwscripts.com> wrote:
John写道:
我似乎终于在遇到很多困难后让MySQL运行了。
在书中它说要输入
mysql>源码C:\ mysql \ newland_tours.sql提示,在我的MySQL副本中生成newland_tours数据库。

当我这样做时它会给我一条错误信息:

错误1044访问被拒绝对于用户:''@ localhost''到数据库
''newland_tours''
确保在mysql中定义了正确的用户并提供它,例如:

path \to\mysql-installation\bin\mysql -uroot -prootpasswd<
I seem to have finally got MySQL running after a lot of difficulty.
In the book it says to type source C:\mysql\newland_tours.sql at the
mysql> prompt, to generate the newland_tours database in my copy of
MySQL.

When I do this however it gives me an error message saying:

Error 1044 Access denied for user: ''@localhost'' to database
''newland_tours''

Make sure that the correct user is defined in mysql and supply it, e.g.:

path\to\mysql-installation\bin\mysql -uroot -prootpasswd <



newland_tours.sql
我究竟如何定义正确的用户并提供它?

当我去mysql>提示我输入你输入的内容吗?

path \to\mysql-installation\bin\mysql -uroot -prootpasswd<
newland_tours.sql

我理解这里的一切:path \\\\mysql-installation\bin\mysql

但我对此没有任何线索:-uroot -prootpasswd<


newland_tours.sql
How exactly do I define correct user and supply it?

When I go to the mysql> prompt do I type in what you have put?

path\to\mysql-installation\bin\mysql -uroot -prootpasswd <
newland_tours.sql

I understand everything here: path\to\mysql-installation\bin\mysql

but I don''t have a clue about this: -uroot -prootpasswd <

有关priveleges的更多信息,请参阅:

http://dev.mysql.com/doc/mysql/en/De...rivileges.html
http://dev.mysql.com/doc/mysql/en/GRANT。 html
For more info on priveleges, see:

http://dev.mysql.com/doc/mysql/en/De...rivileges.html and
http://dev.mysql.com/doc/mysql/en/GRANT.html



我已经看过这些链接以及所有不同的部分和
小节,但这对我来说太复杂了。我只是一个初学者。
我需要它解释一下该做什么。

干杯

John



I have taken a look at these links and all the different sections and
subsections, but it is far too complex for me. I am just a beginner.
I need it explained simply what to do.

Cheers

John




Janwillem Borleffs的意思是这样的:假设你的mysql用户名是

" John"并且你的密码是bafooey,当你在

提示符中启动MySQL时,输入:


path \to \ mysql-installation\bin\mysql -uJohn -pbafooey


在这种情况下,请在提示符下键入:


path \to\mysql-installation\bin\mysql -uroot -p

这将以root用户身份登录(root用户是具有访问权限的用户

到所有数据库和数据库中的所有表)。一旦mysql打开

然后输入:

$ b $ \ u mysql


^选择MySQL数据库您可以在哪里创建用户。创建一个

的用户输入:

GRANT ALL ON newland_tours。* to John @ localhost IDENTIFIED BY" bafooey";


^^该命令用密码bafooey创建用户John。

" newland_tours。*"表示用户John可以访问

newland_tours数据库中的所有表(*表示所有表)。一旦你创建了这个

用户,就可以使用它来处理newland_tours数据库,而不会有

访问问题。


希望这有帮助


- JP



What Janwillem Borleffs meant was this: Suppose your username for mysql is
"John" and your password is "bafooey", when you''re starting up MySQL in the
prompt, type this:

path\to\mysql-installation\bin\mysql -uJohn -pbafooey

However you may not have created any usernames/passwords for MySQL yet... if
this is the case, type this at the prompt instead:

path\to\mysql-installation\bin\mysql -uroot -p

This will log you in as the root user (the root user is the user with access
to all databases and all tables within the databases). Once mysql is open
then type this:

\u mysql

^that selects the MySQL database where you can create users. to create a
user type this:

GRANT ALL ON newland_tours.* TO John@localhost IDENTIFIED BY "bafooey";

^^ that command creates the user John with password "bafooey". the
"newland_tours.*" means that the user John has access to all tables in the
newland_tours database (the * means all tables). Once you have created this
user, you can use it to work on the newland_tours database and not have
access problems.

hope this helped

- JP


这篇关于错误1044拒绝访问数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆