LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-17-2003, 07:51 PM   #1
jakublgz
Member
 
Registered: Apr 2002
Location: Wood Dale IL
Distribution: redhat, slackware
Posts: 110

Rep: Reputation: 15
mysql


Hi. First of all thanx for reading this posting. I read all the posting about the same error posted before. I just installed mysql and:

/# mysql -u root
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO

but when :

root@jakub:/# mysql -u mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 18 to server version: 3.23.55

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

mysql>

it goes on with out even promting for a password. When I tried to change passw. for user root or mysql I get follwing:

root@jakub:/# mysqladmin -u root -p test
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: YES)'

when tried to change password for user mysql:


root@jakub:/# mysqladmin -u mysql -p test
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'mysql@localhost' (Using password: YES)'

Well thats why I am so confused because I can go to mysql with user mysql with out beeing prompted for a passwd. and I can assign a passwd to that user or change it. I did run script mysql_install_db as a user mysql. went through just fine.

Jakub
 
Old 02-17-2003, 08:24 PM   #2
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
AFTER YOU SEE

"Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 18 to server version: 3.23.55

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

mysql>
"
DO THIS!!!

mysql> use mysql;
mysql> UPDATE user SET Password=PASSWORD('mynewpassword') WHERE User='root';
mysql> FLUSH PRIVILEGES;


And you may refer to this thread for more info:

http://www.linuxquestions.org/questi...&postid=226503

Last edited by micxz; 02-17-2003 at 08:25 PM.
 
Old 02-17-2003, 08:29 PM   #3
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
Then if you want to see how many users there are:

mysql shell> use mysql;
mysql shell> select user from user;

I alway do this one:


mysql shell> select user from user were password='';

If you see any users with no pass like root, then change em!! or delete them, most times you will see two root users, one with a pass and one with not! This can be a real security hazzard.

werd'
 
Old 02-17-2003, 08:48 PM   #4
jakublgz
Member
 
Registered: Apr 2002
Location: Wood Dale IL
Distribution: redhat, slackware
Posts: 110

Original Poster
Rep: Reputation: 15
root@jakub:/# mysql -u mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 3.23.55

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

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

Just tried it.
 
Old 02-17-2003, 08:58 PM   #5
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
No pun intended but you messed it up:

root@jakub:/# mysql -u mysql

"-u" is user so your trying to log in to mysql with the user "mysql".

It's

root@jakub:/# mysql -u root

"ERROR 1044: Access denied for user: '@localhost' to database 'mysql'"

says your not logged is as a user. If you were it would say, "denied for user: 'root@localhost' ". If this is the case you need to reset the root pass.
 
Old 02-17-2003, 09:05 PM   #6
jakublgz
Member
 
Registered: Apr 2002
Location: Wood Dale IL
Distribution: redhat, slackware
Posts: 110

Original Poster
Rep: Reputation: 15
root@jakub:/home/jakublgz# mysql -u root
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)

mysql@jakub:/home/jakublgz$ mysql -u root
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)

I can log int to mysql from any user account with out even beeing asked for password. I can not log in from root though. I also can not change the passwd using mysqladmin.
I am new to it so I am not to sure. Should I just reinstall it ? I compiled it myself.
Jakub
 
Old 02-17-2003, 09:06 PM   #7
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
erased double post>

Last edited by micxz; 02-17-2003 at 09:29 PM.
 
Old 02-17-2003, 09:11 PM   #8
jakublgz
Member
 
Registered: Apr 2002
Location: Wood Dale IL
Distribution: redhat, slackware
Posts: 110

Original Poster
Rep: Reputation: 15
root@jakub:/home/jakublgz# mysql -u root
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)

it saz 'root@localhost'
and when
root@jakub:/home/jakublgz# mysqladmin -u root password
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)

:>
?
 
Old 02-17-2003, 09:17 PM   #9
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
My Bad, try:

root@jakub:/home/jakublgz# mysql -u root -p

When it promts for a password just hit enter'

Last edited by micxz; 02-17-2003 at 09:19 PM.
 
Old 02-17-2003, 09:20 PM   #10
jakublgz
Member
 
Registered: Apr 2002
Location: Wood Dale IL
Distribution: redhat, slackware
Posts: 110

Original Poster
Rep: Reputation: 15
root@jakub:/home/jakublgz# mysql -u root -p
Enter password:
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)


see but the think is I never did set one for any of users because I didnt let me . When using mysqladmin I get:
root@jakub:/home/jakublgz# mysqladmin -u root password
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)'
(((
 
Old 02-17-2003, 09:37 PM   #11
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
My last idea is that you shut it down and start the mysql server with "--skip-grant-tables" option. And then go in like before "mysql -u root -p" and set the pass as I described above.

Look here:

http://www.linuxquestions.org/questi...threadid=45551
 
Old 02-17-2003, 09:45 PM   #12
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
too bad you can't use the mysql DB then you can see if root is really there! We now know that there is a user "mysql" that has no priviledge to use the database "mysql".
 
Old 02-17-2003, 09:53 PM   #13
jakublgz
Member
 
Registered: Apr 2002
Location: Wood Dale IL
Distribution: redhat, slackware
Posts: 110

Original Poster
Rep: Reputation: 15
I gues you didnt see me login as user mysql to mysql,,, well neverming I am reinstalling it now.
Thanx for help/
jakub
 
  


Reply



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 On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 02:13 PM
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock welery Linux - Software 19 03-06-2014 07:19 AM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 01:52 AM
Problems with MySQL on SuSE: Can't Connect (/var/lib/mysql/mysql.sock) neocookie Linux - Software 8 02-07-2008 11:48 PM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration