Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 01-24-2010, 07:59 AM   #1
LQ Newbie
Registered: Dec 2009
Distribution: Slackware 13
Posts: 15

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


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 08:00 AM.
Old 01-24-2010, 08:22 AM   #2
Senior Member
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 51
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, 08:27 AM   #3
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: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060
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, 08:28 AM   #4
Registered: Mar 2007
Distribution: Slackware
Posts: 264

Rep: Reputation: 68
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 08:43 AM. Reason: typo's
Old 01-24-2010, 06:58 PM   #5
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, 06:54 PM   #6
LQ Newbie
Registered: Jan 2009
Location: Chicago, IL USA
Distribution: CentOS 6.4
Posts: 11

Rep: Reputation: 0

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.



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 - mysql_install_db (error) n0p.cracker Linux - Server 1 08-04-2008 01:23 PM
mysql mysql_install_db problems xrado Slackware 3 05-09-2006 02:10 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 09:44 AM
MySQL user setup pembo13 Linux - Software 5 11-23-2003 11:00 PM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:49 AM.

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