How to start/stop MySql server on Ubuntu 8.04

Posted: May 20, 2008 in Database, Linux, Ubuntu
Tags:

# To install MySql database:

sudo apt-get install mysql-server

# To start MySql server:

/etc/init.d/mysql start

# To stop MySql server:

/etc/init.d/mysql stop

# To restart MySql server:

/etc/init.d/mysql restart

# To check the status of  MySql server:

/etc/init.d/mysql status

Comments
  1. Alexandre says:

    I’m from Brazil!!!!
    very good…

  2. auravisya says:

    Yes, very nice blog.

    Thanks for the tips.

  3. I’m new to ubuntu and mysql..
    thks for the help!

  4. raz says:

    thankz it helped a lot. and now i have successfully installed all of them and i have to configure the apache .conf file

  5. Gagat Rahina says:

    Thank about your information..This is so important for me..
    Because i often make it for my job …
    Thank it helped me alot..
    Ok

  6. Anbalagan says:

    the commands wave very useful to me.

  7. scapegraceboy says:

    Helpfully 😉

  8. Didula Lakshitha says:

    Thanks for your information

  9. gaurav says:

    Great blog
    Helped me a lot

  10. Jhon says:

    Thanks , very good

  11. Good post. Following might be easier especially for Windows folks are more used to services.

    sudo service mysql start/stop/restart

  12. santosh says:

    hi i used the code but output is coming permission denied

  13. abbysays says:

    try the command with ‘sudo’ in the beginning.

  14. Kuldeep says:

    Thanks for these useful handy commands.

  15. Adam S. says:

    Hi. I am trying to get rid of mysql server 5.0 on ubuntu 8.04 and I get this. help
    Removing mysql-server-5.0 …
    /etc/lsb-base-logging.sh: line 84: INITOUTPUT: unbound variable
    invoke-rc.d: initscript mysql, action “stop” failed.
    dpkg: error processing mysql-server-5.0 (–purge):
    subprocess pre-removal script returned error exit status 1
    /etc/lsb-base-logging.sh: line 84: INITOUTPUT: unbound variable
    invoke-rc.d: initscript mysql, action “stop” failed.
    /etc/lsb-base-logging.sh: line 84: INITOUTPUT: unbound variable
    invoke-rc.d: initscript mysql, action “start” failed.
    dpkg: error while cleaning up:
    subprocess post-installation script returned error exit status 1
    Errors were encountered while processing:
    mysql-server-5.0
    E: Sub-process /usr/bin/dpkg returned an error code (1)

  16. Beny says:

    very useful commands. thanks Abby!!

  17. Omkar says:

    Great Article!!!!
    Complete and Presise!!
    Thanks a lot!!!!!!!

  18. gordon yeong says:

    thanks for that. Indeed very handy 🙂

  19. stefanus says:

    i tried to start it but i got this ..

    navets@navets-laptop:~$ sudo mysql start
    [sudo] password for navets:
    ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO)

    i iam using password to my php .. but how to write it ?

    • g says:

      wanna access ur mysql?

      to gain more power, log in using root account like this command;

      $> mysql -u root –password=myPassword;

      Done!

  20. g says:

    thank thank thank… u.

    alhamdulillah 😀

  21. s says:

    log_prod.log

  22. Thank you very much. Succinct and needed.

    I’ve been wrestling with my MySQL installation all day.

  23. […] Comments nzherdev on How to install Evernote 3.0 on…Matt Rhys-Davies on How to start/stop MySql server…marrymatrimony on Search Engine Historys on How to start/stop MySql server…Abhishek […]

  24. Arjohn G. Poquiz says:

    Yey! Thanks for this blog! I’m new to Ubuntu…Great job!

  25. bhan singh says:

    its very useful

  26. Estinfo says:

    This is nice post… can find words to describe how I needed to reboot my mysql.

  27. Thanks a million…!:)

  28. Sachin says:

    Hi
    When I typed command to restart mysql .. It gave me error

    $ sudo mysql restart
    ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO)

  29. Cesar says:

    Works like a charm, thank you very much!

  30. maex says:

    tx guys very much help on this

Leave a reply to maex Cancel reply