LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 01-24-2010, 06:59 AM   #1
slackmate
LQ Newbie
 
Registered: Dec 2009
Distribution: Slackware 13
Posts: 15

Rep: Reputation: 0
MySQL setup: I ran mysql_install_db ***without *** --user=mysql.


Hi,

I tried to install (enable rather) MySQL on Slackware 13. I followed the standard instrucitons - checked mysql user/goups were present, created my.cnf file, etc and then I ran the mysql_install_db script ***without*** the --user=mysql flag. Oops, Ouch. I was logged in as root.

When I tried to re-run the script with the flag it started erroing with problems like" 'mysql-bin.index file not found' - I fixed that by locating it and changing the ownership on it to mysql from root, but the script returns more errors - now it's 'mysql.db is not BASE TABLE'.

I do not know Linux well enough to go and fix all the damage I've caused by forgetting the --user=mysql flag. Is it at all possible to undo the install script and start over? I looked at the scripts in /usr/bin/ and could not see anything that would hint at this possibility. Does anyone know what to do? Many thanks in advance!

Last edited by slackmate; 01-24-2010 at 07:00 AM.
 
Old 01-24-2010, 07:22 AM   #2
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
Hi slackmate,
You should try removing (do a backup first, ALWAYS ) the contents of /var/lib/mysql and /var/run/mysql. Of course, stop mysql daemon first with sh /etc/rc.d/rc.mysql stop
Then, run mysql_install_db again.
 
1 members found this post helpful.
Old 01-24-2010, 07:27 AM   #3
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
All you have to do is log in as root (or sudo) delete the entire /var/lib/mysql directory then execute mysql_install_db --user=mysql.
 
1 members found this post helpful.
Old 01-24-2010, 07:28 AM   #4
XGizzmo
Member
 
Registered: Mar 2007
Distribution: Slackware
Posts: 264

Rep: Reputation: 69
Copied more or less from /etc/rc.d/rc.mysqld with a few edits.

To start MySQL automatically at boot, be sure this script is executable, do this as root:
# chmod 755 /etc/rc.d/rc.mysqld

To remove the databases and start over, do this as root:
# rm -rf /var/lib/mysql/*

To install an initial database, do this as root:
# mysql_install_db --user=mysql

To increase system security:
# mysql_secure_installation

Last edited by XGizzmo; 01-24-2010 at 07:43 AM. Reason: typo's
 
Old 01-24-2010, 05:58 PM   #5
slackmate
LQ Newbie
 
Registered: Dec 2009
Distribution: Slackware 13
Posts: 15

Original Poster
Rep: Reputation: 0
Deleting the contents of /var/lib/mysql and re-runing the script worked. /var/run/mysql/ was empty.
 
Old 01-28-2010, 05:54 PM   #6
440Music
LQ Newbie
 
Registered: Jan 2009
Location: Chicago, IL USA
Distribution: CentOS 6.4
Posts: 11

Rep: Reputation: 0
Cool

I followed the info in this post and didn't get mysql to start until I went to /var/lib/mysql

chown mysql:mysql -R mysql

Then mysql started and I was able to log-in and change password.

Tom
 
  


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
mysql - mysql_install_db (error) n0p.cracker Linux - Server 1 08-04-2008 12:23 PM
mysql mysql_install_db problems xrado Slackware 3 05-09-2006 01:10 AM
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
MySQL user setup pembo13 Linux - Software 5 11-23-2003 10:00 PM

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

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