Mysql installation on ubuntu

Installation

To install MySQL, run the following command from a terminal prompt:
sudo apt-get install mysql-server

or get it from Ubuntu software center –
During the installation process you will be prompted to enter a password for the MySQL root user.

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:mysql         *:*                     LISTEN      2556/mysqld

If the server is not running correctly, you can type the following command to start it:
sudo /etc/init.d/mysql restart

Launching
$ sudo su
$mysql
you will get the mysql prompth
mysql>

Configuration

You can edit the /etc/mysql/my.cnf file to configure the basic settings — log file, port number, etc.
CREATE USER ‘user1’@’localhost’ IDENTIFIED BY ‘pass1’;
GRANT SELECT,INSERT,UPDATE,DELETE ON *.* TO ‘user1’@’localhost’;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s