473,396 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Command Line Client vs DOS Prompt

I'm a newbie to MySQL and am really confused about when I should be using
the Command Line Client and when the DOS prompt.

I'm using Windows XP and I've just installed MySQL 4.1.10.

I can use the Command Line Client to logon as 'root'. It prompts me for a
password and then I can create databases, etc. from the mysql prompt.
However, if I wanted to logon as a different user, I'm not sure how to do
it.

The MySQL Manual suggests that I should be able to do this sort of thing at
the C:\ prompt. But all I get there is a message: "Access denied for user
'ODBC' @ 'localhost' (using password: NO)". I've made sure that the PATH is
set up correctly.

Why can't I use the C:\ prompt?

Paul.
Jul 23 '05 #1
6 14576
Paul Deverson wrote:
The MySQL Manual suggests that I should be able to do this sort of thing at
the C:\ prompt. But all I get there is a message: "Access denied for user
'ODBC' @ 'localhost' (using password: NO)". I've made sure that the PATH is
set up correctly.


Hard to tell what you are doing wrong without seeing what you are doing.
Let me show an example. Komments marked with # in the example.

# I start as a root user from mysql and create new account for me
mysql> grant all on lamyle.* to testuser@localhost identified by 'password';
Query OK, 0 rows affected (0.00 sec)

# I quit the mysql, to go back to console
# (which you call DOS promt
mysql> exit
Bye

# I'm in the mysql\bin folder and start mysql-console program
C:\mysql\bin>mysql -u testuser -p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 4.1.7

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

# status-command shows the username (there should be other ways
# to check that also)
mysql> status
--------------
mysql Ver 14.7 Distrib 4.1.7, for Win95/Win98 (i32)

Connection id: 3
Current database:
# This line tells me that I am logged in as a correct user,
# called testuser
Current user: testuser@localhost

< Rest of the print is removed >
Jul 23 '05 #2
Thanks for your help.

1st part OK. I created a new database and then granted privileges to a new
user with a password.

I then quit the MySQL Command Line Client and opened my Command Prompt.

At the C:\ prompt I typed
mysql

I got the same "Access denied..." statement.

Nothing I tried here got me past this denied access. (BTW, are you really
inserting a ">" ?).

Back in the MySQL Command Line Client I tried the status command I got a
similar output to you. But it was based on root@localhost which is not
surprising as I can only logn with my original root password.

BTW, because it's version 4.1.10, it's installed itself into C:\Program
Files\MySQL\MySQL Server 4.1\bin but my PATH allows for that.

Paul.
"Aggro" <sp**********@yahoo.com> wrote in message
news:vZ***************@read3.inet.fi...
Paul Deverson wrote:
The MySQL Manual suggests that I should be able to do this sort of thing
at the C:\ prompt. But all I get there is a message: "Access denied for
user 'ODBC' @ 'localhost' (using password: NO)". I've made sure that the
PATH is set up correctly.


Hard to tell what you are doing wrong without seeing what you are doing.
Let me show an example. Komments marked with # in the example.

# I start as a root user from mysql and create new account for me
mysql> grant all on lamyle.* to testuser@localhost identified by
'password';
Query OK, 0 rows affected (0.00 sec)

# I quit the mysql, to go back to console
# (which you call DOS promt
mysql> exit
Bye

# I'm in the mysql\bin folder and start mysql-console program
C:\mysql\bin>mysql -u testuser -p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 4.1.7

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

# status-command shows the username (there should be other ways
# to check that also)
mysql> status
--------------
mysql Ver 14.7 Distrib 4.1.7, for Win95/Win98 (i32)

Connection id: 3
Current database:
# This line tells me that I am logged in as a correct user,
# called testuser
Current user: testuser@localhost

< Rest of the print is removed >

Jul 23 '05 #3
Paul Deverson wrote:
At the C:\ prompt I typed
mysql
Don't type just mysql, or it will try to login anonymously. You should type:
mysql -u yourusername -p

Where -p means that you will be asked for a password.
I got the same "Access denied..." statement.

Nothing I tried here got me past this denied access. (BTW, are you really
inserting a ">" ?).
No, the > in "C:\mysql\bin>mysql -u testuser -p" is just automaticly
inserted character in my console. so if I don't type anything, it says:
"C:\mysql\bin>" on my console.
BTW, because it's version 4.1.10, it's installed itself into C:\Program
Files\MySQL\MySQL Server 4.1\bin but my PATH allows for that.


I think you can tell 4.1 where to install itself. You have propably
installed it to default location, but that shouldn't matter.
Jul 23 '05 #4
I've just tried again. At the command prompt I've changed directories and
got to C:\Program Files\MySQL\MySQL Server 4.1\bin>.

Without pressing enter, I've added "mysql -u mynewusername -p"

I was prompted for a password but when I entered the password corresponding
to the new username, I got:

Error 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

I tried it again using "root" instead of my new user name and was again
prompted for a password. I entered the password corresponding to my root
login. I got the same error message.

Paul.
"Aggro" <sp**********@yahoo.com> wrote in message
news:1K**************@read3.inet.fi...
Paul Deverson wrote:
At the C:\ prompt I typed
mysql


Don't type just mysql, or it will try to login anonymously. You should
type:
mysql -u yourusername -p

Where -p means that you will be asked for a password.
I got the same "Access denied..." statement.

Nothing I tried here got me past this denied access. (BTW, are you
really inserting a ">" ?).


No, the > in "C:\mysql\bin>mysql -u testuser -p" is just automaticly
inserted character in my console. so if I don't type anything, it says:
"C:\mysql\bin>" on my console.
BTW, because it's version 4.1.10, it's installed itself into C:\Program
Files\MySQL\MySQL Server 4.1\bin but my PATH allows for that.


I think you can tell 4.1 where to install itself. You have propably
installed it to default location, but that shouldn't matter.

Jul 23 '05 #5
Paul Deverson wrote:
Error 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)


Do you have the server running? Can you see any processes called mysqld
in your process list?
Jul 23 '05 #6
You're a genius!

I set MySQL up as a service and now it's working perfectly.

Thank you very much indeed.

Paul.
"Aggro" <sp**********@yahoo.com> wrote in message
news:Mk*************@read3.inet.fi...
Paul Deverson wrote:
Error 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)


Do you have the server running? Can you see any processes called mysqld in
your process list?

Jul 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: glenn | last post by:
I keep reading all sorts of books on VS that keep telling me to click on Tools/Visual Studio Command prompt to run this program or that program. However, I do not have such a menu choice. Where is...
34
by: Roman Mashak | last post by:
Hello, All! I'm implementing simple CLI (flat model, no tree-style menu etc.). Command line looks like this: <command> <param1> <param2> ... <paramN> (where N=1..4) And idea is pretty simple: ...
9
by: Endless Story | last post by:
My last version of Python was 2.4, running smoothly on XP with path c: \Python24 - no need even to include this path in PATH; everything worked as it's supposed to at the command line. Just...
4
by: =?Utf-8?B?WUlndWNoaQ==?= | last post by:
Hi , I want to run a batch file from the c# code. Every time i run the batch file command prompt is displayed. I do not want to show this command prompt. Is there any way to suppress the...
4
by: Peter Nimmo | last post by:
Hi, I am writting a windows application that I want to be able to act as if it where a Console application in certain circumstances, such as error logging. Whilst I have nearly got it, it...
13
by: c3950ig | last post by:
Hi, I am python newbie and the command prompt is having an issue with python. I installed python 2.4.4 onto my windows machine, opened a command prompt window, and typed python to start the...
51
by: Ojas | last post by:
Hi!, I just out of curiosity want to know how top detect the client side application under which the script is getting run. I mean to ask the how to know whether the script is running under...
5
by: waltbrad | last post by:
Hi folks. I'm learning Python from the Mark Lutz Book, Programming Python 3rd edition. He seems to be able to invoke the Python interpreter from any command line prompt. C:\temp>python ...
7
by: Jwe | last post by:
Hi, I've written a program which has both a command line interface and Windows form interface, however it isn't quite working correctly. When run from command line with no arguments it should...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.