Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to install & uninstall MYSQL in ubuntu

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 842
    Comment on it

    Firstly, you need to remove the current MySQL if you are already using:

    $ sudo apt-get purge mysql-client-core-5.5
    

    Now, to install MySQL, by running the following commands in terminal:

    $ sudo apt-get install mysql-server
    $ sudo apt-get install mysql-client
    

    During the installation you will be asked to enter a password for the MySQL root user.

    Use any password you like and remember it.

     

    For Mysql-Workbench(optional):

    sudo apt-get install mysql-workbench
    

     

    First you have to remove mysql completely from your system using following commands in terminal

    sudo apt-get remove --purge mysql-server mysql-client mysql-common
    
    sudo apt-get update && sudo apt-get upgrade
    
    sudo apt-get autoremove
    
    sudo apt-get autoclean

    Now try to reinstall Mysql.

     

    To open mysql command line:

    sudo mysql -u root -p password

     

    View all existing databases:

    show databases;

     

    If you want to use an existing database:

    use DATABASE_NAME;

     

    Or, create a database by following command:

    create database db_name

     

    If you wish to view all tables use command:

    show tables;

     

    If you want to IMPORT an existing database with .sql file, use the following command:

    Note: Before imposting you need to use a database into which you need to import your dump.

    mysql> \. home/db_dump.sql;

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: