Console denies acces to MySql

Alles, was MariaDB und MySQL betrifft, kann hier besprochen werden.

Console denies acces to MySql

Postby estudiante » 07. May 2009 11:21

Hi,

I can acces my databases using phpmyadmin. When I try to to this from the comand promt (mysql console) I just get the message "acces denied for user ''@'localhost' to database ...". I understand that because I haven't already typed my passwort, but how can I "tell" the console that I wnt to log in as 'root'??

Thanks a lot for your help.
estudiante
 
Posts: 15
Joined: 04. May 2009 10:08

Re: Console denies acces to MySql

Postby Wiedmann » 07. May 2009 11:35

but how can I "tell" the console that I wnt to log in as 'root'??

http://dev.mysql.com/doc/refman/5.1/en/mysql.html
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Console denies acces to MySql

Postby estudiante » 07. May 2009 12:32

Wiedmann wrote:
but how can I "tell" the console that I wnt to log in as 'root'??

http://dev.mysql.com/doc/refman/5.1/en/mysql.html


Hi Wiedmann, thanks a lot, but I keep on having problems. Why is the mysql-console all the time waiting for Sql-Statments? But when I write sql-statements it denies me the acces...
estudiante
 
Posts: 15
Joined: 04. May 2009 10:08

Re: Console denies acces to MySql

Postby Wiedmann » 07. May 2009 12:41

Why is the mysql-console all the time waiting for Sql-Statments?

http://dev.mysql.com/doc/refman/5.1/en/mysql.html wrote:Then type an SQL statement, end it with “;”, \g, or \G and press Enter


But when I write sql-statements it denies me the acces...

You are using a user wrong user?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Console denies acces to MySql

Postby estudiante » 07. May 2009 12:44

But when I write sql-statements it denies me the acces...

You are using a user wrong user?[/quote]

Yes,I´m certainly using the wrong user, the problem is that I would like to chance the user but the console keeps on waiting for sql statements...
estudiante
 
Posts: 15
Joined: 04. May 2009 10:08

Re: Console denies acces to MySql

Postby Wiedmann » 07. May 2009 12:45

Maybe you should explain, what exactly you are doing and typing. (step by step)...
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Console denies acces to MySql

Postby estudiante » 07. May 2009 12:52

allright. First of all, I must tell you I´m executing the file mysql from the mysql/bin directory. I thought the promted console would ask me for a password but it didn´t. I just get to read "mysql>".
If I try to create a database typing "CREATE DATABASE mydatabase;" I´ll get the answer "access denied..." or something like that. Ans if I try to type "--user:root --password:apassword" it will tell me there was a mistake in the sql-syntax.
estudiante
 
Posts: 15
Joined: 04. May 2009 10:08

Re: Console denies acces to MySql

Postby Wiedmann » 07. May 2009 12:57

Ans if I try to type "--user:root --password:apassword"

That are parameters for the program "mysql.exe".
(And not something to type in, if the client/program is already running.)

BTW: I can't see these colons ":" in the manual?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Console denies acces to MySql

Postby estudiante » 07. May 2009 13:10

I don´t understand that. If I doubleclic at mysql.exe I get the mysql-console opened, don`t I?
What do you mean with the parameters?

(about the colons ":", that was a mistake)
estudiante
 
Posts: 15
Joined: 04. May 2009 10:08

Re: Console denies acces to MySql

Postby Wiedmann » 07. May 2009 13:21

- First open a console / command line (cmd.exe)
- then go to the mysql directory
- then start the MySQL command line client together with the parameters: "mysql.exe --param1 --param2 ...".
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Console denies acces to MySql

Postby estudiante » 07. May 2009 13:28

Wiedmann wrote:- First open a console / command line (cmd.exe)
- then go to the mysql directory
- then start the MySQL command line client together with the parameters: "mysql.exe --param1 --param2 ...".


ok. I´m allready there, I mean at C:xampp\mysql> . What I´m exactly supposed to write in order to log in?
estudiante
 
Posts: 15
Joined: 04. May 2009 10:08

Re: Console denies acces to MySql

Postby Wiedmann » 07. May 2009 13:35

I mean at C:xampp\mysql>

The program "mysql.exe" is in the directory "C:xampp\mysql\bin".

What I´m exactly supposed to write in order to log in?

mysql.exe --user=root --password=apassword
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Console denies acces to MySql

Postby estudiante » 07. May 2009 13:40

Wiedmann wrote:
I mean at C:xampp\mysql>

The program "mysql.exe" is in the directory "C:xampp\mysql\bin".

What I´m exactly supposed to write in order to log in?

mysql.exe --user=root --password=apassword


ok, I did that, but the answer surprises me: "Access denied for user 'root'@'localhost' (using password: YES)"
estudiante
 
Posts: 15
Joined: 04. May 2009 10:08

Re: Console denies acces to MySql

Postby Wiedmann » 07. May 2009 13:50

ok, I did that, but the answer surprises me: "Access denied for user 'root'@'localhost' (using password: YES)"

So your password is wrong.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Console denies acces to MySql

Postby estudiante » 07. May 2009 14:03

I got a new problem. I can acces mysql and create databases and so on from the console. So far so good. I just try to acces mysql from phpmyadmin and I get an error message (access denied): "Die Verbindung konnte aufgrund von ungültigen Einstellungen nicht hergestellt werden."

???
estudiante
 
Posts: 15
Joined: 04. May 2009 10:08

Next

Return to MariaDB - MySQL

Who is online

Users browsing this forum: No registered users and 6 guests