LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 08-23-2009, 02:18 PM   #1
sabir_mustafa
Member
 
Registered: Aug 2009
Location: Rawalpindi
Distribution: RHEL 5, CentOS
Posts: 38

Rep: Reputation: 16
Question mysql Authentication problem


Dear all:
I m planning to configure a LAMP for the first time. Every thing work fine except mysql. It is my first experience of configuring mysql in linux.
After the installation of mysql, the /etc/hosts file is as under

=======================
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
#::1 system7.exmple.com system7
172.21.1.1 system7.example.com system7
========================

but i m getting the following error

[root@system7 ~]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

[root@system7 ~]# mysql -h system7 -u root -p
Enter password:
ERROR 1130 (00000): Host 'system7.example.com' is not allowed to connect to this MySQL server

[root@system7 ~]# mysql -h localhost -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[root@system7 ~]#

I had consulted an article on howtoforge.com but even after applying those changes, my system does not accept the password. The "localhost" entry is also not present in the "user" table. Please help me to solve this problem.
 
Old 08-23-2009, 02:38 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 23,931

Rep: Reputation: 7022Reputation: 7022Reputation: 7022Reputation: 7022Reputation: 7022Reputation: 7022Reputation: 7022Reputation: 7022Reputation: 7022Reputation: 7022Reputation: 7022
Quote:
Originally Posted by sabir_mustafa View Post
Dear all:
I m planning to configure a LAMP for the first time. Every thing work fine except mysql. It is my first experience of configuring mysql in linux.
After the installation of mysql, the /etc/hosts file is as under

=======================
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
#::1 system7.exmple.com system7
172.21.1.1 system7.example.com system7
========================

but i m getting the following error

[root@system7 ~]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

[root@system7 ~]# mysql -h system7 -u root -p
Enter password:
ERROR 1130 (00000): Host 'system7.example.com' is not allowed to connect to this MySQL server

[root@system7 ~]# mysql -h localhost -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[root@system7 ~]#

I had consulted an article on howtoforge.com but even after applying those changes, my system does not accept the password. The "localhost" entry is also not present in the "user" table. Please help me to solve this problem.
Try (as root), just typing in "mysql", and pressing enter. If this is a new installation, it should let you right in as root.

Look at the "grant" options in the MySQL knowledgebase, for details on how to add/modify users. You're probably having issues because you're putting password/host options in. The password, by the way, is for the root user in MySQL, NOT the Linux root user. The two are different.

Also, since you applied changes from "an article", if this doesn't work for you, it would help if you actually told us WHAT you did....
 
Old 08-23-2009, 06:56 PM   #3
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1040Reputation: 1040Reputation: 1040Reputation: 1040Reputation: 1040Reputation: 1040Reputation: 1040Reputation: 1040
It is no good experimenting as Linux root. Do this in your own user account.

TB0ne is right, the root pwd for mysql is blank after a fresh installation, so log in into mysql as:
mysql -uroot

Remember that Linux root and mysql root don't have any relationship. Check these chapters: http://dev.mysql.com/doc/refman/5.0/...anagement.html.

jlinkels
 
Old 08-26-2009, 12:09 PM   #4
sabir_mustafa
Member
 
Registered: Aug 2009
Location: Rawalpindi
Distribution: RHEL 5, CentOS
Posts: 38

Original Poster
Rep: Reputation: 16
Finally I have resolved the problem. It was my mistake to delete localhost line from user table. I completed the required line and it is all ok now. Thanks for support.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Postfix and MySQL Authentication using LAMP martinezjr Linux - Server 0 09-13-2008 10:05 AM
Samba authentication through PAM with MySQL Problem limty Linux - Server 2 12-31-2007 07:54 AM
squid authentication with mysql Pratik H Pandya Linux - Networking 2 10-26-2006 08:11 AM
Authentication to SSH via MySQL wellard1981 Linux - Security 5 04-21-2004 09:30 AM
MySql authentication on RedHat RKris Linux - Networking 3 03-17-2003 10:48 PM

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

All times are GMT -5. The time now is 07:17 PM.

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