LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 02-21-2004, 07:19 AM   #1
Raptor Ramjet
Member
 
Registered: Apr 2003
Location: Under a rock
Distribution: Slackware "current" - Praise "Bob" !!!!
Posts: 92

Rep: Reputation: 15
MySQL: Access denied error


Hello,

I'm trying to install MySQL on Slackware 9.1 and, following quite a bit of time on the web, I've tried installing it using the following steps:

1. Downloaded mysql-<version>.tgz file from Slackware site.

2. Ran installpkg mysql-<version>.tgz

3. cp /etc/my-medium.cnf /etc/my.cnf

4. Edited the /usr/bin/mysql_install_db script and replaced the line containing

hostname=`/bin/hostname`

with

hostname=`/bin/hostname -f `

5. Changed to mysql user

su - mysql

6. Installed MySQL databases

mysql_install_db

7. Launched the MySQL daemon

mysqld_safe &

8. Set a password for root using the following (obviously using "real" values for 'password' and 'myhost' etc.)

mysqladmin -u root password 'password'

9. Attempted to set password for host using:

mysqladmin -u root -h myhost.mydomain password 'password'

Sadly this fails with the following error:

mysqladmin: connect to server at 'myhost.mydomain' failed
error: 'Host 'myhost' is not allowed to connect to this MySQL server

So this is obviously a permissions error but I'm stumped if I can work out what's wrong ? If anyone can point me in the right direction I'd be most grateful as it's entirely frustrating trying to Google up the correct answer...

Thankyou
 
Old 02-21-2004, 10:20 AM   #2
Raptor Ramjet
Member
 
Registered: Apr 2003
Location: Under a rock
Distribution: Slackware "current" - Praise "Bob" !!!!
Posts: 92

Original Poster
Rep: Reputation: 15
Hhmmm...

Well after much fiddling around, scratching of head and readng manuals and online help I perfomed a reboot (shutdown -r now) after which it appears that MySQL is working properly (don't know why this shuld make a difference as I've been stopping and starting the mysql daemon between attempts) .

Oh well... I can now log into my test database etc. etc. so now it's onto trying to install phpBB2 (just for the exercise)

So I suppose this will lead to more swearing.........
 
Old 02-21-2004, 01:51 PM   #3
Raptor Ramjet
Member
 
Registered: Apr 2003
Location: Under a rock
Distribution: Slackware "current" - Praise "Bob" !!!!
Posts: 92

Original Poster
Rep: Reputation: 15
Following on.......

I'm now trying to install phpBB2 but am having trouble setting up a user to do so. Having given up doing this totally manually I've installed webmin and am now trying to do so via a combination of its interface and the command line. I have been trying to install phpbb2 via it's install page but this consistently fails with a permission error on the database.

The databases and permissions I have set up in mysql are:

Database, User, Hosts, Permissions
phpbb2db, phpbb2user, any, all
test, anonymous, any, (a list of permissions including, Select, Insert etc.)
test\_%, anonymous, any, same (list of permissions including, Select, Insert etc.)

The users and permissions I have set up in mysql are (I have also set up passwords but haven't shown them here):

User, Host, Permissions
Anonymous,localhost,none
Anonymous,myhost,none
phpbb2user,myhost,all
root,localhost,all
root,myhost,all

Now when I open a terminal and use

mysql -u root phpbb2db -p

I am prompted for a password and can then use mysql (which I immediately 'quit' !). However when I use

mysql -u phpbb2user phpbb2db -p

I am prompted for the password, I enter it correctly, but I get an error message saying:

ERROR 1045: Access denied for user 'phpbb2user@localhost' (Using password: YES)

So... I am now utterly confused as to what I'm supposed to do to get this working ? and, having spent all afternoon reading FAQs and manuals etc., would be most grateful for some advice.

Thankyou
 
Old 02-22-2004, 05:30 AM   #4
Raptor Ramjet
Member
 
Registered: Apr 2003
Location: Under a rock
Distribution: Slackware "current" - Praise "Bob" !!!!
Posts: 92

Original Poster
Rep: Reputation: 15
Well I'm feeling decidedly schizophrenic today (and slightly unloved) as again I'm replying to my own posts.....

But after powering off my box last night then starting it up again this morning I can now access my mysql database using the users I've set up. The only difference being that, before I shut down the box, I rememberred to set permissions on the rc.mysqld script so mysql would be run at startup i.e.

chmod 755 /etc/rc.d/rc.mysqld

So now I'm just puzzled why this should cause things to start working (or was it the reboot) ? I was manually stopping and restarting the mysql service between attempts yesterday, via webmin & "mysqld_safe &", and it jus't wouldn't work.

Oh well... just shows that incompetence with perseverance sometimes does the trick

Yours off re-reading the mysql help & FAQs.
 
Old 02-22-2004, 06:51 AM   #5
Erol
Member
 
Registered: Jan 2004
Location: Vienna/Austria
Distribution: Slackware 10.0 (kernel 2.6.7)
Posts: 46

Rep: Reputation: 15
I guess you should have done "mysqladmin reload", so that your permissions changes in the database itself are applied.
 
Old 02-22-2004, 08:07 AM   #6
Raptor Ramjet
Member
 
Registered: Apr 2003
Location: Under a rock
Distribution: Slackware "current" - Praise "Bob" !!!!
Posts: 92

Original Poster
Rep: Reputation: 15
Cheers Erol.

I hadn't spotted that in the manual yet - the mysql manual is after all quite comprehensive (i.e. large)

But now I know how to do it in the future. I'll write it up in my log.

Thanks for the advice
 
  


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
MySQL access denied newlinuxnewbie Linux - General 3 10-25-2005 04:42 AM
mysql/php access denied error Chuck23 Linux - Software 3 02-15-2005 06:36 PM
MySQL: 'access denied for user' turbo_acura Linux - General 1 10-20-2004 08:34 AM
MYSQL access denied for user c0c0deuz Linux - General 1 03-18-2003 02:44 PM
MySQL - access denied X11 Linux - Software 1 08-19-2002 05:51 AM


All times are GMT -5. The time now is 07:34 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration