Install MySQL Database server on Ubuntu

On February 10, 2011, in Ubuntu, by mike

MySQL server on Ubuntu

MySQL is a fast, multi-threaded, multi-user, and robust SQL database server. It is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software.
Installation

To install MySQL, run the following command from a terminal prompt:

sudo apt-get install mysql-server mysql-client

Once the installation is complete, the MySQL server should be started automatically. You can run the following command from a terminal prompt to check whether the MySQL server is running:

sudo netstat -tap | grep mysql

When you run this command, you should see the following line or something similar:

tcp        0      0 localhost.localdomain:mysql           *:* LISTEN -

If the server is not running correctly, you can type the following command to start it:

sudo /etc/init.d/mysql restart

Configuration

By default, the administrator password is not set. Once you install MySQL, the first thing you must do is to configure the MySQL administrator password. To do this, run the following commands:

sudo mysqladmin -u root password newrootsqlpassword

sudo mysqladmin -u root -h localhost password newrootsqlpassword

You can edit the /etc/mysql/my.cnf file to configure the basic settings — log file, port number, etc. Refer to /etc/mysql/my.cnf file for more details.

Tagged with:  

Leave a Reply

Premium WordPress Themes

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Copyright © 2005-2010 Linux Server™. Use of this web site constitutes acceptance of the Linux Server™ Terms of Use and Privacy Policy. en-US Linux is a trademark registered by Linus Torvalds in the United States and other countries.