Find the answer to your Linux question:
Results 1 to 4 of 4
RHEL 5.2, mysql 5.0.45 Long story short... I needed to shrink the size of the ibdata1 file. I dumped --all-databases to a file, stopped MySQL, rm -fr /var/lib/mysql/* and then ...
  1. #1
    Linux Newbie jnojr's Avatar
    Join Date
    Sep 2007
    Posts
    105

    MySQL won't start

    RHEL 5.2, mysql 5.0.45

    Long story short... I needed to shrink the size of the ibdata1 file. I dumped --all-databases to a file, stopped MySQL, rm -fr /var/lib/mysql/* and then started MySQL. It bombs out saying no such process, referring to line 159 of /etc/init.d/mysql Each time, the process it's referring to is different.

    How do I get MySQL to start like it's brand-new so I can re-import my databases?

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,695
    Reinstall MySQL.

    You can't delete the MySQL schema database and expect it to run.

    MySQL Documentation

  3. #3
    Linux Newbie jnojr's Avatar
    Join Date
    Sep 2007
    Posts
    105
    This was something I had specifically asked about before starting this, and nobody ever said, "No, don't delete those files". Frickin' wonderful.

    Reinstalling MySQL isn't going to be a problem, so long as someone at the remote site can find a Red Hat DVD (why there aren't some immediately at hand, or images, or a local yum repo, is beyond me...) But when I try to restore my dump, is MySQL going to cry because there'll already be a mysql database? Can I sort out the different databases from my all.sql file and restore individually?

  4. #4
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,695
    Asking a question on a forum is like asking a random collection of people on the street. No, it's worse, because you can't *see* the person responding to even guess their level of competence. Of all the responses you get, *maybe* 10% will have a relevant *guess* and 2% or less will actually know what they're talking about.

    When working with data you care about: move/copy/tar it first. You can always delete it later.

    You can reference lots of restore guides via Google. I know MS SQL doesn't like to have its master DB restored/overwritten without specific steps, but I am not sure about MySQL. I would guess *worst case* would be that your DB gets restored, but the mysql DB won't restore. In that case, all of your DB users/rights would need to be recreated.

    As noted in the linked webpage:

    1) Log in and create your "user" databases.

    2) Try and restore everything from the dump:

    Code:
    mysql -u root -p password < /tmp/dbdumpfile.sql
    3) If that fails, restore your individual user DB's:

    Code:
    mysql -u root -p password db_name  < /tmp/dbdumpfile.sql
    Last edited by HROAdmin26; 08-31-2009 at 08:57 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...