Linux.com

Home Linux Community Community Blogs Personal Installing and Using Mysql on Ubuntu

Installing and Using Mysql on Ubuntu

1. run following command in terminal
  
   sudo apt-get install mysql-server

    during the installation process it will ask for root password

2. to check whether the Mysql server is installed & running properly,run
  
   sudo netstat -tap | grep mysql

   you sholud see now the following lines or something similar:
  
   tcp        0      0 localhost.localdo:mysql *:*                     LISTEN      13059/mysqld

3. If in case your server is not running properly you can restart it by running following command
   sudo /etc/init.d/mysql restart

Using Mysql
4. when mysql is installed, you can start it by running:

 mysql -u root -p

the command prompt will change now to mysql>

5. to create database use:
    create database databasename;
6. to use database use:
    use databasename;

from here on you can create table,insert into table and peroform other mysql actions

1. run following command in terminal
  
   sudo apt-get install mysql-server

    during the installation process it will ask for root password

2. to check whether the Mysql server is installed & running properly,run
  
   sudo netstat -tap | grep mysql

   you sholud see now the following lines or something similar:
  
   tcp        0      0 localhost.localdo:mysql *:*                     LISTEN      13059/mysqld

3. If in case your server is not running properly you can restart it by running following command
   sudo /etc/init.d/mysql restart

Using Mysql
4. when mysql is installed, you can start it by running:

 mysql -u root -p

the command prompt will change now to mysql>

5. to create database use:
    create database databasename;
6. to use database use:
    use databasename;

from here on you can create table,insert into table and peroform other mysql actions

 

Comments

Subscribe to Comments Feed
  • Jayne Simmons Said:

    Thanks for the tutorial!! Very helpful :)

  • gulam Said:

    Failed to fetch http://mirror.cse.iitk.ac.in/ubuntu/pool/main/m/mysql-5.5/mysql-server_5.5.40-0ubuntu0.12.04.1_all.deb Cannot initiate the connection to 3142:80 (0.0.12.70). - connect (22: Invalid argument) E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? ...i got this error while tried to install mysql..in ubuntu.. can i fix this problem..?

  • gulam Said:

    Failed to fetch http://mirror.cse.iitk.ac.in/ubuntu/pool/main/m/mysql-5.5/mysql-server_5.5.40-0ubuntu0.12.04.1_all.deb Cannot initiate the connection to 3142:80 (0.0.12.70). - connect (22: Invalid argument) E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? ...i got this error while tried to install mysql..in ubuntu.. can i fix this problem..?

Upcoming Linux Foundation Courses

  1. LFD320 Linux Kernel Internals and Debugging
    03 Nov » 07 Nov - Virtual
    Details
  2. LFS416 Linux Security
    03 Nov » 06 Nov - Virtual
    Details
  3. LFS426 Linux Performance Tuning
    10 Nov » 13 Nov - Virtual
    Details

View All Upcoming Courses


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board