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

Upcoming Linux Foundation Courses

  1. LFD320 Linux Kernel Internals and Debugging
    04 Aug » 08 Aug - Virtual
    Details
  2. LFD405 Embedded Linux Development with Yocto Project
    04 Aug » 07 Aug - Santa Clara, CA
    Details
  3. LFD312 Developing Applications For Linux
    18 Aug » 22 Aug - 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