I am new to mysql and am having some problems. Whenever I start up the server with /etc/rc.d/mysql start it starts up great. I have been able to run a few tests that show some of the server's internal variables etc, so I am able to communicate with it. Whenever I try to change the root password I get this: root@maniac:/var/lib/mysql > mysqladmin -u root -p password Enter password: mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user: 'root@localhost' (Using password: YES)' I have perused some resources looking for answers to this. Not finding any yet I decided to do some of my own checking. I ran strace on the mysqladmin program and it produced the following: read(3, "A\0\0\2", 4) = 4 read(3, "\377\25\4Access denied for user: \'root"..., 65) = 65 shutdown(3, 2 /* send and receive */) = 0 close(3) = 0 write(2, "\7", 1) = 1 write(2, "mysqladmin", 10mysqladmin) = 10 write(2, ": ", 2: ) = 2 write(2, "connect to server at \'localhost\'"..., 111connect to server at 'localhost' failed error: 'Access denied for user: 'root@localhost' (Using password: YES)') = 111 write(2, "\n", 1 ) The 3 above refers to a local UNIX socket that has been created when the server started up. As you can see a message is coming back from the server telling me access is denied with errno = 111 or: Error code 111: Connection refused It looks like something is wrong with the server, but I am at a loss as to how to turn debugging on or anything else. I cannot strace it because it forks off a child and the parent is left to wait. Any suggestions would be appreciated. I am pretty sure I have tried on the obvious things. Thanks.
On Friday 10 May 2002 23.00, Jesse Marlin wrote:
I am new to mysql and am having some problems. Whenever I start up the server with /etc/rc.d/mysql start it starts up great. I have been able to run a few tests that show some of the server's internal variables etc, so I am able to communicate with it. Whenever I try to change the root password I get this:
root@maniac:/var/lib/mysql > mysqladmin -u root -p password Enter password:
What do you enter here? The default root password is blank, so just press enter. And to set the password you're supposed to give it as a parameter. This is from the startup message you get when you start the server. PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! This is done with: /usr/bin/mysqladmin -u root -p password 'new-password' regards Anders
Anders Johansson writes:
On Friday 10 May 2002 23.00, Jesse Marlin wrote:
I am new to mysql and am having some problems. Whenever I start up the server with /etc/rc.d/mysql start it starts up great. I have been able to run a few tests that show some of the server's internal variables etc, so I am able to communicate with it. Whenever I try to change the root password I get this:
root@maniac:/var/lib/mysql > mysqladmin -u root -p password Enter password:
What do you enter here? The default root password is blank, so just press enter. And to set the password you're supposed to give it as a parameter. This is from the startup message you get when you start the server.
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! This is done with: /usr/bin/mysqladmin -u root -p password 'new-password'
Okay I tried with a password:
mysqladmin -u root -p password 'something' Enter password:
At the 'Enter password:' I just reentered it. This is kinda confusing behavior. Now when I run mysql:
mysql ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)
What does this 'Using password: NO' mean. It used to be set to YES. Thanks.
On Friday 10 May 2002 23.23, Jesse Marlin wrote:
At the 'Enter password:' I just reentered it. This is kinda confusing
As I said, the default password is blank so you should just press enter. If you already set a password (i.e. if just pressing enter doesn't work) there's no need to go through this step again.
behavior. Now when I run mysql:
mysql
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)
What does this 'Using password: NO' mean. It used to be set to YES. Thanks.
It's set to YES if you tell it to use a password mysql -p regards Anders
Anders Johansson writes:
On Friday 10 May 2002 23.23, Jesse Marlin wrote:
At the 'Enter password:' I just reentered it. This is kinda confusing
As I said, the default password is blank so you should just press enter. If you already set a password (i.e. if just pressing enter doesn't work) there's no need to go through this step again.
behavior. Now when I run mysql:
mysql
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)
What does this 'Using password: NO' mean. It used to be set to YES. Thanks.
It's set to YES if you tell it to use a password
mysql -p
Thanks. That did it. One more question. I want to be able to create a database as one of my users, but it is saying I do not have access. mysql> CREATE DATABASE mydb; ERROR 1044: Access denied for user: '@localhost' to database 'mydb' Now this is my lazy side coming out. Do you know what to do to alleviate this error message. I am not sure how I want to setup mysql as far as security goes, I just want to create some databases right now. Thanks.
On Fri, May 10, 2002 at 05:39:26PM -0400, Jesse Marlin wrote:
Thanks. That did it. One more question. I want to be able to create a database as one of my users, but it is saying I do not have access.
mysql> CREATE DATABASE mydb; ERROR 1044: Access denied for user: '@localhost' to database 'mydb'
Now this is my lazy side coming out. Do you know what to do to alleviate this error message. I am not sure how I want to setup mysql as far as security goes, I just want to create some databases right now. Thanks.
Please look at this page: http://www.mysql.com/doc/A/c/Access_denied.html This should be also helpful in your problem: http://www.mysql.com/doc/A/d/Adding_users.html Regards, -Kastus
Konstantin (Kastus) Shchuka writes:
On Fri, May 10, 2002 at 05:39:26PM -0400, Jesse Marlin wrote:
Thanks. That did it. One more question. I want to be able to create a database as one of my users, but it is saying I do not have access.
mysql> CREATE DATABASE mydb; ERROR 1044: Access denied for user: '@localhost' to database 'mydb'
Now this is my lazy side coming out. Do you know what to do to alleviate this error message. I am not sure how I want to setup mysql as far as security goes, I just want to create some databases right now. Thanks.
Please look at this page: http://www.mysql.com/doc/A/c/Access_denied.html
This should be also helpful in your problem: http://www.mysql.com/doc/A/d/Adding_users.html
Thanks. Anders helped me to use the INSERT technique. I will have to try the GRANT technique.
Jesse Marlin writes:
Anders Johansson writes:
On Friday 10 May 2002 23.00, Jesse Marlin wrote:
I am new to mysql and am having some problems. Whenever I start up the server with /etc/rc.d/mysql start it starts up great. I have been able to run a few tests that show some of the server's internal variables etc, so I am able to communicate with it. Whenever I try to change the root password I get this:
root@maniac:/var/lib/mysql > mysqladmin -u root -p password Enter password:
What do you enter here? The default root password is blank, so just press enter. And to set the password you're supposed to give it as a parameter. This is from the startup message you get when you start the server.
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! This is done with: /usr/bin/mysqladmin -u root -p password 'new-password'
Okay I tried with a password:
mysqladmin -u root -p password 'something' Enter password:
At the 'Enter password:' I just reentered it. This is kinda confusing behavior. Now when I run mysql:
mysql ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)
What does this 'Using password: NO' mean. It used to be set to YES. Thanks.
Never mind.
mysql -p Enter password:
Works. Thanks for the help.
participants (3)
-
Anders Johansson
-
Jesse Marlin
-
Konstantin (Kastus) Shchuka