Results 1 to 10 of 10
  1. #1
    Join Date
    Jan 2007
    Posts
    360

    How would I run this command?

    Hey,

    Sorry not very experianced with server management.

    I am trying to run this command to optimize and repair all my databases on the server.

    Code:
    mysqlcheck -u root -p --auto-repair --check --optimize --all-databases
    After I run it, I get this:


    Code:
    # mysqlcheck -u root -p --auto-repair --check --optimize --all-databases
    Enter password:

    What password do I enter there? Do I enter my root SSH password? I tried that didnt work.

    I am not sure what my mysql root password is, as I never set any. I just have user and passwords for separate databases.

    Please help.

    Thanks.

  2. #2
    Join Date
    May 2006
    Location
    San Francisco
    Posts
    7,200
    What happens if you just press enter? That would assume no root mysql pass.

  3. #3
    Join Date
    Feb 2004
    Location
    UK
    Posts
    1,429
    Hi

    It this is a Cpanel server then cat /root/.my.cnf (note the "." is not a mistake) then you can see the root password.

    Or try

    mysqlcheck --auto-repair --check --optimize --all-databases
    And see what happens.

    Thanks

  4. #4
    Join Date
    Jan 2007
    Posts
    360
    Enter password:
    mysqlcheck: Got error: 1045: Access denied for user 'root'@'localhost' (using p ssword: NO) when trying to connect


    That happens....

    This is plesk server.


    # mysqlcheck --auto-repair --check --optimize --all-databases
    mysqlcheck: Got error: 1045: Access denied for user 'root'@'localhost' (using password: NO) when trying to connect


    Still not working

  5. #5
    Join Date
    Feb 2004
    Location
    UK
    Posts
    1,429
    Is it a cpanel server ? if so then you can reset the password in WHM.

    If not then you need to start the mysql server in safe mode (cant quite recall how you do this)

    if you google "how to reset mysql root password" im sure you see lots of howto's

    Good luck.

    Andrew

  6. #6
    Join Date
    Jan 2010
    Location
    San Francisco
    Posts
    1,799
    Doing a bit of research, it seems Plesk creates an 'admin' account with root privileges. Try using the 'admin' user with your admin account password.

  7. #7
    Join Date
    Jan 2007
    Posts
    360
    Quote Originally Posted by WickedFactor View Post
    Doing a bit of research, it seems Plesk creates an 'admin' account with root privileges. Try using the 'admin' user with your admin account password.
    Thanks it worked. It was admin as username and password as plesk password

    Thank you for all the help.

  8. #8
    Join Date
    Jan 2007
    Posts
    360
    Just one more thing, how would I edit this command to just optimize and repair only 1 database?


    mysqlcheck -u root -p --auto-repair --check --optimize --all-databases

  9. #9
    Join Date
    Jan 2007
    Location
    /dev/null
    Posts
    3,696
    --all-databases <- replace this with --databases <name> (you might even be able to skip it with only 1 database, but don't pin me to that).

  10. #10
    Join Date
    Jan 2007
    Posts
    360
    Thanks. It worked.

Similar Threads

  1. Run A Command In MySQL?
    By Dave_Z in forum Web Design and Content
    Replies: 2
    Last Post: 05-04-2007, 10:35 PM
  2. Perl: how to run a command line command from inside perl
    By fozzy in forum Programming Discussion
    Replies: 3
    Last Post: 10-28-2005, 11:34 AM
  3. How can I run this command every 1 min
    By cannibal in forum Hosting Security and Technology
    Replies: 10
    Last Post: 02-08-2005, 05:30 PM
  4. How can I run this command every 1 hour
    By zoomx in forum Hosting Security and Technology
    Replies: 9
    Last Post: 08-16-2004, 06:30 PM
  5. Linux command/script to run a command for every file in a directory tree?
    By civ in forum Hosting Security and Technology
    Replies: 5
    Last Post: 01-25-2004, 08:48 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
  •