Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
Then I run
mysqladmin --verbose -u root password
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
I suspect maybe the OP made a syntax error when he created the password.
I believe the easiest way to proceed is to see if he can get in with "mysql" (either with or without a password) and see if he can list the mysql users.
Further: he if can't, then the specific error message (which I asked him to cut/paste) should be instructive.
IMHO .. PSM
PS:
I just spent the last two hours debugging what (I thought!) was a simple MySql permissions problem myself
First of all, you cannot use your password with the mysql command.
It should be something like this:
Code:
mysql -h <host> -u <user> -p
After executing this command you will be prompted for your password. If you do try to add your password to the command, then it will think it is the database name and fail.
I was also wondering if you installed MySQL from source or from a repository? Probably from source, but just to be sure...
That's why I said that... I have tried it on my server and it failed miserably.
Tried it again and you are right it works, but only when there is no space between -p and the password.
Anyway, the way the OP tries to connect will certainly not work.
If it fails, please cut/paste the exact error message (everything except the actual password)
Quote:
Then I run
mysqladmin --verbose -u root password
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
also
Quote:
mysql --verbose -u root password
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Maybe it has to do with the 'localhost' ?? In the netstat I see
Quote:
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
That should be right, right?? '0.0.0.0' is any port?
Also, I installed using yum, nothing special, just standard rpm stuff.
After this you will be prompted for the password.
You probably don't want to use mysqladmin anymore. The 'mysql' command is used to maintain databases.
After this you will be prompted for the password.
You probably don't want to use mysqladmin anymore. The 'mysql' command is used to maintain databases.
The root password has been not been set yet, so it fails:
Code:
mysql --verbose -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[root@hplaptop ~]# /usr/bin/mysqladmin -u root password newpassword
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
[root@hplaptop ~]# usr/bin/mysqladmin -h 0.0.0.0 -u root password newpassword
-bash: usr/bin/mysqladmin: No such file or directory
[root@hplaptop ~]# /usr/bin/mysqladmin -h 127.0.0.1 -u root password newpassword
/usr/bin/mysqladmin: connect to server at '127.0.0.1' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
mysql -uroot -pYOUR_PASSWORD mysql
select User,Host from user;
quit;
A: It was in the first post
RESPONSE: Uh - no. I didn't see "mysql" anywhere before your most recent post.
Quote:
Q: Are you sure you didn't set a password for root yet?
RESPONSE: Excellent question. ARE you sure you didn't set the password for "root" yet???
OK: this isn't rocket science. Please do this:
Quote:
1. Try "mysql" with the "root" password you *might* have entered.
Use "mysql" (accept no substitutes ).
Do *not* put spaces between the "-u" and "-p" parameters.
Type EXACTLY like this (substituting your actual password):
OK: this isn't rocket science. Please do this:
Quote:
1. Try "mysql" with the "root" password you *might* have entered.
Use "mysql" (accept no substitutes ).
Do *not* put spaces between the "-u" and "-p" parameters.
Type EXACTLY like this (substituting your actual password):
Quote:
mysql -uroot -pPASSWORD mysql
2. If it succeeds, you're home free.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.