LinuxQuestions.org
Review your favorite Linux distribution.
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 07-09-2008, 07:52 AM   #1
alienDog
Member
 
Registered: Apr 2004
Location: Europe
Distribution: Debian, Slackware
Posts: 505

Rep: Reputation: 48
Slackware 12.1 MySQL doesn't allow root login


I have a fresh installation of Slackware 12.1 and I'm trying to get MySQL working.

mysql_install_db says:

Installation of system tables failed!

I do get the server up and running after changing the ownership of the files under /var/lib/mysql to mysql:mysql, but MySQL still doesn't let me in:

Access denied for user 'root'@'localhost' (using password: NO)

I have not set the mysql root password, so this is probably due to the problem with mysql_install_db. What's wrong here?
 
Old 07-09-2008, 08:38 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Oops -- OK, how did you run mysql_install_db... you have to run it as root (as in logged in as root or sudo) and you have to use it with the user argument; i.e.,
Code:
<log in as root or sudo>
mysql_install_db --user=mysql
If you did not do it that way, you can blow away /var/lib/mysql (if you don't have data bases in it -- and be careful) and try it again.

You can also (after removing the /var/lib/mysql tree, carefully) use
Code:
mysql_secure_installation
it interactively asks questions about initialization.

See the MySQL manual, section 4.6.6 for mysql_install_db and section 4.4.7 for mysql_secure_installation

Last edited by tronayne; 07-09-2008 at 08:39 AM.
 
Old 07-09-2008, 09:38 AM   #3
alienDog
Member
 
Registered: Apr 2004
Location: Europe
Distribution: Debian, Slackware
Posts: 505

Original Poster
Rep: Reputation: 48
Hmm... I think it was because my hostname was localhost that mysql_install_db failed...

I did not use --user=mysql the first time, but trashing /var/lib/mysql and using --user didn't fix the problem until I changed the hostname.

After changing the hostname and running mysql_install_db with --user=mysql, MySQL finally works.

Thanks
 
  


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: still can't login after root password reset andredude Linux - Software 4 12-19-2014 06:30 PM
MySQL root login problem AnRkey Linux - Software 2 05-10-2006 05:31 AM
Big problem changed root password for mysql can't login pls comment johnnydangerous Linux - Software 5 07-08-2005 01:22 AM
Slackware 10.1 Root Login Failure squiggerz Slackware 6 02-21-2005 01:41 PM
Mysql Root Login SilentK Linux - Newbie 11 08-14-2004 12:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:33 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