2

I download mysql-5.6.16-debian6.0-x86_64.deb from official site.
Install using dpkg -i mysql-5.6.16-debian6.0-x86_64.deb
It does create file in /opt/mysql/server-5.6/.

root@ubuntu:~# cd /var/lib/mysql/
bash: cd: /var/lib/mysql/: No such file or directory
root@ubuntu:~$ service mysql start
mysql: unrecognized service
root@ubuntu:~$ chown -R mysql /opt/mysql/server-5.6/
chown: invalid user: mysql
root@ubuntu:~$ chgrp -R mysql /opt/mysql/server-5.6/
chgrp: invalid group: mysql

I don't know how to deal with this...

root@ubuntu:~# ls -l /opt/mysql/server-5.6/
total 152
drwxr-xr-x  2 root root  4096 Mar 12 11:56 bin
-rw-r--r--  1 root root 17987 Jan 14 23:38 COPYING
drwxr-xr-x  2 root root  4096 Mar 12 11:56 docs
drwxr-xr-x  3 root root  4096 Mar 12 11:56 include
-rw-r--r--  1 root root 88109 Jan 14 23:38 INSTALL-BINARY
drwxr-xr-x  3 root root  4096 Mar 12 11:56 lib
drwxr-xr-x  4 root root  4096 Mar 11 16:32 man
drwxr-xr-x 10 root root  4096 Mar 12 11:56 mysql-test
-rw-r--r--  1 root root  2496 Jan 14 23:38 README
drwxr-xr-x  2 root root  4096 Mar 12 11:56 scripts
drwxr-xr-x 28 root root  4096 Mar 12 11:56 share
drwxr-xr-x  4 root root  4096 Mar 12 11:56 sql-bench
drwxr-xr-x  3 root root  4096 Mar 12 11:56 support-files
Mithril
  • 2,381
  • 3
  • 22
  • 30

4 Answers4

4

You don't have to do that:

easily you can install mysql:

server:

sudo apt-get install mysql-server

client only

sudo apt-get install mysql-client

If you want newer versions than default in Ubuntu

for version 5.5;

sudo  apt-add-repository ppa:ondrej/mysql-5.5

for version 5.6;

sudo  apt-add-repository ppa:ondrej/mysql-5.6

After adding your needed version, update sources lis:

sudo apt-get update

now install mysql

server:

sudo apt-get install mysql-server

client only

sudo apt-get install mysql-client
Maythux
  • 84,289
1

According to the official MySql Site for community Server Installation, you can follow the guide described here.

This guide helps you configure an apt repository for MySQL products according to your OS Version and MySQL Product (server, connectors) version. In brief for Ubuntu 12.04 and MySQL Server 5.6 you follow the step below.

  1. Download the APT package, in our case mysql-apt-config_0.3.5-1ubuntu12.04_all.deb
  2. Run it using # dpkg -i mysql-apt-config_0.3.5-1ubuntu12.04_all.deb
  3. Update APT source list # apt-get update
  4. Install as usual # apt-get install mysql-server
Athafoud
  • 181
  • Please update your answer. I tried following it and there are some additional steps necessary in order to install this mysql-apt-config .deb file since this answer was posted on September 3, 2015. – karel Jun 24 '20 at 13:56
0

If you install mysql server from .deb file, it stores the service file inside /etc/init.d directory as mysql.server.So to start the mysql server service, you have to run the below command,

sudo service mysql.server start

To initialize mysql Data directory, see this documentation page.

Avinash Raj
  • 78,556
0

ppa:ondrej/mysql-5.6 stopped working a few days ago for me on CircleCI for some reason (the tests suddenly broke and Circle didn't change anything). I'm now upgrading MySQL 5.5 -> 5.6 based on instructions here. It uses the official MySQL apt.

echo "deb http://repo.mysql.com/apt/ubuntu/ precise mysql-apt-config" | sudo tee /etc/apt/sources.list.d/mysql.list
echo "deb http://repo.mysql.com/apt/ubuntu/ precise mysql-5.6" | sudo tee /etc/apt/sources.list.d/mysql.list
curl -s http://ronaldbradford.com/mysql/mysql.gpg | sudo apt-key add -
sudo apt-get update
sudo service mysql stop
sudo apt-get install -y mysql-server
sudo mysql_upgrade -uroot # -p omitted as the circleci default container has no password
mahemoff
  • 667
  • 2
    ppa:ondrej/mysql-5.6 doesn't support Ubuntu Precise now, see the notice I just wrote here: https://deb.sury.org/ubuntu-precise-and-PHP-5.4-eol.html – oerdnj Dec 31 '15 at 19:01