Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I tried mysql in my command line :

I get :

The program 'mysql' is currently not installed.  You can install it by typing:
sudo apt-get install mysql-client-core-5.5

But when I do:

sudo apt-get install mysql-client-core-5.5

But I get:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
mysql-client-core-5.5 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 47 not upgraded.

I'm very much confused!

Thanks in advance.

share|improve this question
    
What does ls -l /usr/bin/mysql say? –  Florian Diesch Aug 10 '12 at 6:44
    
This is what I got ls: cannot access /usr/bin/mysql: No such file or directory, when I do ls -l /usr/bin/mysql –  batman Aug 10 '12 at 6:46
1  
Try sudo apt-get --reinstall install mysql-client-core-5.5 –  StarNamer Aug 10 '12 at 22:24

5 Answers 5

First, remove the current version of MySQL you're already using:

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

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

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

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.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

You can edit the /etc/mysql/my.cnf file to configure the basic settings: log file, port number, etc.

share|improve this answer
    
@batman we are expecting some reply from you or at least a verified marking –  sumitramteke Sep 16 at 5:42
    
tomkat thanks for this clean process.. –  sumitramteke Sep 16 at 5:43
    
most of this answer appears to be cut and paste from help.ubuntu.com/12.04/serverguide/mysql.html –  Matt O'Brien Oct 25 at 4:27

This is the mysql server witch you need.

sudo apt-get install mysql-server

The client you need it if you want to run commands from the workbench and not from a terminal. so this is optional.

sudo apt-get install mysql-client

and for Mysql-Workbench(optional):

sudo apt-get install mysql-workbench
share|improve this answer

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.

share|improve this answer

That suggestion seems a little bizzare because it would miss out other dependencies and utilities. I would just run this and be done with it:

sudo apt-get install mysql-client
share|improve this answer

I had, and solved, the same problem. I fixed it by using Synaptic to install mysql. To do this, run:

sudo synaptic

Then search for mysql and select the required package to install.

share|improve this answer
1  
:)) what kind of an answer :)) –  Aleks Feb 21 at 10:42

protected by Community Nov 23 '13 at 11:54

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.