Newbie question re error message

This is a discussion on Newbie question re error message within the MySQL Database forums, part of the Database Forums category; Hi all I have installed MySQL 4.0.25 (and PHP 4.4.2.2) on my Windows XP Pro ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-16-2006
Plato
 
Posts: n/a
Default Newbie question re error message

Hi all

I have installed MySQL 4.0.25 (and PHP 4.4.2.2) on my Windows XP Pro system
using IISadmin. PHP is working OK but MySQL shows the MySQL Monitor prompt
OK - as follows:

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 4.0.25-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create database printsdb;
ERROR 1044: Access denied for user: '@localhost' to database 'printsdb'
mysql>

As you can see when I try to create a DB I get the error message shown.
Also when trying "show databases;" [without quotes] I get only the Test DB
shown. I assume this is a permission problem but cannot resolve it. I am
logged in as root with mypassword. I do have Administartor privelegs on my
machine and PHP and MySQl are both located on my machine.
Can anyone help please?

Thanks

Plato


Reply With Quote
  #2 (permalink)  
Old 03-16-2006
Gordon Burditt
 
Posts: n/a
Default Re: Newbie question re error message

>mysql> create database printsdb;
>ERROR 1044: Access denied for user: '@localhost' to database 'printsdb'
>mysql>
>
>As you can see when I try to create a DB I get the error message shown.
>Also when trying "show databases;" [without quotes] I get only the Test DB
>shown. I assume this is a permission problem but cannot resolve it. I am
>logged in as root with mypassword.


Are you *SURE* you are logged in as root? Shouldn't the above
error message say 'root@localhost' if you were?

>I do have Administartor privelegs on my
>machine and PHP and MySQl are both located on my machine.


Gordon L. Burditt
Reply With Quote
  #3 (permalink)  
Old 03-16-2006
Bill Karwin
 
Posts: n/a
Default Re: Newbie question re error message

"Plato" <aqwp51@dsl.pipex.com> wrote in message
news:0ZGdnfYaBIONAYTZRVnyjg@pipex.net...
> mysql> create database printsdb;
> ERROR 1044: Access denied for user: '@localhost' to database 'printsdb'


This indicates you are connected to MySQL as the anonymous user. The MySQL
login is totally separate from the account you use to log in to your Windows
XP system. Having Administrator privileges for your Windows account means
nothing to MySQL.

You can specify the user when running the MySQL tools, for example:
C:> mysql -u root -p
Password: ...type password here for MySQL root user, not Windows admin
account...

mysql> SELECT USER();
root@localhost

Read these sections of the manual for more information about accounts and
privileges:
http://dev.mysql.com/doc/refman/4.1/...rivileges.html
http://dev.mysql.com/doc/refman/4.1/...ing-users.html

Regards,
Bill K.


Reply With Quote
  #4 (permalink)  
Old 03-16-2006
Plato
 
Posts: n/a
Default Re: Newbie question re error message

Hi

Thanks all.

I thought it was solved! But when entering -u root -p; I get the following
error message:

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 4.0.25-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> -u root -p;
ERROR 1064: You have an error in your SQL syntax. Check the manual that
corresp
onds to your MySQL server version for the right syntax to use near '-u
root -p'
at line 1
mysql>

Surely the syntax is correct?

Any ideas?

Thanks

Plato

"Bill Karwin" <bill@karwin.com> wrote in message
news:dvceah02cg5@enews4.newsguy.com...
> "Plato" <aqwp51@dsl.pipex.com> wrote in message
> news:0ZGdnfYaBIONAYTZRVnyjg@pipex.net...
>> mysql> create database printsdb;
>> ERROR 1044: Access denied for user: '@localhost' to database 'printsdb'

>
> This indicates you are connected to MySQL as the anonymous user. The
> MySQL login is totally separate from the account you use to log in to your
> Windows XP system. Having Administrator privileges for your Windows
> account means nothing to MySQL.
>
> You can specify the user when running the MySQL tools, for example:
> C:> mysql -u root -p
> Password: ...type password here for MySQL root user, not Windows admin
> account...
>
> mysql> SELECT USER();
> root@localhost
>
> Read these sections of the manual for more information about accounts and
> privileges:
> http://dev.mysql.com/doc/refman/4.1/...rivileges.html
> http://dev.mysql.com/doc/refman/4.1/...ing-users.html
>
> Regards,
> Bill K.
>



Reply With Quote
  #5 (permalink)  
Old 03-16-2006
Gordon Burditt
 
Posts: n/a
Default Re: Newbie question re error message

>I thought it was solved! But when entering -u root -p; I get the following
>error message:


What's the command you entered to get the below response?
It should be something like this:
>> C:> mysql -u root -p


>
>Welcome to the MySQL monitor. Commands end with ; or \g.
>Your MySQL connection id is 4 to server version: 4.0.25-nt
>
>Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
>
>mysql> -u root -p;


You don't enter that at a mysql> prompt, you enter it as arguments
to the 'mysql' command at a COMMAND.COM prompt.


>ERROR 1064: You have an error in your SQL syntax. Check the manual that
>corresp
>onds to your MySQL server version for the right syntax to use near '-u
>root -p'
>at line 1
>mysql>
>
>Surely the syntax is correct?


Gordon L. Burditt
Reply With Quote
  #6 (permalink)  
Old 03-17-2006
Plato
 
Posts: n/a
Default Re: Newbie question re error message

Hi Gordon

I opened mysql monitor and got the following mysql prompt:

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 4.0.25-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

At this prompt I entered -u root -p; and got the Error 1064 (below).

Does this help?

Thanks

Plato

"Gordon Burditt" <gordonb.uiw0v@burditt.org> wrote in message
news:121jm13ri77mrec@corp.supernews.com...
> >I thought it was solved! But when entering -u root -p; I get the
> >following
>>error message:

>
> What's the command you entered to get the below response?
> It should be something like this:
>>> C:> mysql -u root -p

>
>>
>>Welcome to the MySQL monitor. Commands end with ; or \g.
>>Your MySQL connection id is 4 to server version: 4.0.25-nt
>>
>>Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
>>
>>mysql> -u root -p;

>
> You don't enter that at a mysql> prompt, you enter it as arguments
> to the 'mysql' command at a COMMAND.COM prompt.
>
>
>>ERROR 1064: You have an error in your SQL syntax. Check the manual that
>>corresp
>>onds to your MySQL server version for the right syntax to use near '-u
>>root -p'
>>at line 1
>>mysql>
>>
>>Surely the syntax is correct?

>
> Gordon L. Burditt



Reply With Quote
  #7 (permalink)  
Old 03-17-2006
Gordon Burditt
 
Posts: n/a
Default Re: Newbie question re error message

>I opened mysql monitor

You're supposed to do that *WITH COMMAND LINE ARGUMENTS*.

>At this prompt I entered -u root -p; and got the Error 1064 (below).


Gordon L. Burditt
Reply With Quote
  #8 (permalink)  
Old 03-17-2006
Bill Karwin
 
Posts: n/a
Default Re: Newbie question re error message

"Plato" <aqwp51@dsl.pipex.com> wrote in message
news:sJadnasI071OPIfZRVnyvw@pipex.net...
> mysql>
> At this prompt I entered -u root -p; and got the Error 1064 (below).


You need to supply the options -u root -p as arguments to the command to run
the mysql monitor, not as a statement after the mysql monitor has opened.

So the sequence should look similar to this, starting from the DOS shell
prompt:

C:\>mysql -u root -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.18-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> select user();
+----------------+
| user() |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.08 sec)

mysql>

Regards,
Bill K.


Reply With Quote
  #9 (permalink)  
Old 03-18-2006
Plato
 
Posts: n/a
Default Re: Newbie question re error message

Thanks guys.

I had tried that at one stage with the following result:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Gordon>cd\

C:\>mysql -u root -p;
'mysql' is not recognized as an internal or external command,
operable program or batch file.

C:\>mysql -u root -p
'mysql' is not recognized as an internal or external command,
operable program or batch file.

C:\>

MySQL is installed in the default location. You will see I tried both with
and without the ending ";". I should add that I did not have any of these
problems when I installed MySQL 3.23.49 so I am inclined to re-install that
unless there any good reasons for not doing so.

Does any of this help?

Plato


"Gordon Burditt" <gordonb.uiw0v@burditt.org> wrote in message
news:121jm13ri77mrec@corp.supernews.com...
> >I thought it was solved! But when entering -u root -p; I get the
> >following
>>error message:

>
> What's the command you entered to get the below response?
> It should be something like this:
>>> C:> mysql -u root -p

>
>>
>>Welcome to the MySQL monitor. Commands end with ; or \g.
>>Your MySQL connection id is 4 to server version: 4.0.25-nt
>>
>>Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
>>
>>mysql> -u root -p;

>
> You don't enter that at a mysql> prompt, you enter it as arguments
> to the 'mysql' command at a COMMAND.COM prompt.
>
>
>>ERROR 1064: You have an error in your SQL syntax. Check the manual that
>>corresp
>>onds to your MySQL server version for the right syntax to use near '-u
>>root -p'
>>at line 1
>>mysql>
>>
>>Surely the syntax is correct?

>
> Gordon L. Burditt



Reply With Quote
  #10 (permalink)  
Old 03-18-2006
Jerry Stuckle
 
Posts: n/a
Default Re: Newbie question re error message

Plato wrote:
> Thanks guys.
>
> I had tried that at one stage with the following result:
>
> Microsoft Windows XP [Version 5.1.2600]
> (C) Copyright 1985-2001 Microsoft Corp.
>
> C:\Documents and Settings\Gordon>cd\
>
> C:\>mysql -u root -p;
> 'mysql' is not recognized as an internal or external command,
> operable program or batch file.
>
> C:\>mysql -u root -p
> 'mysql' is not recognized as an internal or external command,
> operable program or batch file.
>
> C:\>
>
> MySQL is installed in the default location. You will see I tried both with
> and without the ending ";". I should add that I did not have any of these
> problems when I installed MySQL 3.23.49 so I am inclined to re-install that
> unless there any good reasons for not doing so.
>
> Does any of this help?
>
> Plato
>
>
> "Gordon Burditt" <gordonb.uiw0v@burditt.org> wrote in message
> news:121jm13ri77mrec@corp.supernews.com...
>
>>>I thought it was solved! But when entering -u root -p; I get the
>>>following
>>>error message:

>>
>>What's the command you entered to get the below response?
>>It should be something like this:
>>
>>>> C:> mysql -u root -p

>>
>>>Welcome to the MySQL monitor. Commands end with ; or \g.
>>>Your MySQL connection id is 4 to server version: 4.0.25-nt
>>>
>>>Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
>>>
>>>mysql> -u root -p;

>>
>>You don't enter that at a mysql> prompt, you enter it as arguments
>>to the 'mysql' command at a COMMAND.COM prompt.
>>
>>
>>
>>>ERROR 1064: You have an error in your SQL syntax. Check the manual that
>>>corresp
>>>onds to your MySQL server version for the right syntax to use near '-u
>>>root -p'
>>>at line 1
>>>mysql>
>>>
>>>Surely the syntax is correct?

>>
>>Gordon L. Burditt

>
>
>


So, where did you install mysql? What's *your* default location?

You either need to:
1. Be in the directory containing mysql.exe, or
2. Provide the path (absolute or relative) to mysql.exe in your
command, or
3. Have the directory containing mysql.exe in your PATH environment
variable.

This has nothing to do with the version of mysql installed. Rather, its
your lack of experience in running from a command prompt.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:23 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0