Documentation Home
MySQL 5.6 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 31.1Mb
PDF (A4) - 31.1Mb
PDF (RPM) - 30.3Mb
EPUB - 7.8Mb
HTML Download (TGZ) - 7.6Mb
HTML Download (Zip) - 7.6Mb
HTML Download (RPM) - 6.5Mb
Eclipse Doc Plugin (TGZ) - 8.3Mb
Eclipse Doc Plugin (Zip) - 10.1Mb
Man Pages (TGZ) - 182.5Kb
Man Pages (Zip) - 293.9Kb
Info (Gzip) - 2.9Mb
Info (Zip) - 2.9Mb
Excerpts from this Manual

MySQL 5.6 Reference Manual  /  ...  /  Installing MySQL on Linux Using Debian Packages from Oracle

2.5.6 Installing MySQL on Linux Using Debian Packages from Oracle

Oracle provides Debian packages for installing MySQL on Debian or Debian-like Linux systems. The packages are available through two different channels:

  • The MySQL APT Repository, supporting the Debian 7 and 8, and Ubuntu 12, 14, and 15 platforms. For details, see Section 2.5.3, “Installing MySQL on Linux Using the MySQL APT Repository”.

  • The MySQL Developer Zone's Download Area. For details, see Section 2.1.2, “How to Get MySQL”. The following are some information on the Debian packages available there and the instructions for installing them:

    • You may also need to install the libaio library if it is not already present on your system:

      shell> sudo apt-get install libaio1
      
    • For Debian 7 and 8, and Ubuntu 12, 14, and 15:

      • Various Debian packages are provided in the MySQL Developer Zone for installing different components of MySQL. The preferred method is to use the tarball bundle, which contains the packages needed for a basic setup of MySQL. The tarball bundles have names in the format of mysql-server_MVER-DVER_CPU.deb-bundle.tar. MVER is the MySQL version and DVER is the Linux distribution version. The CPU value indicates the processor type or family for which the package is built, as shown in the following table:

        Table 2.9 MySQL Debian 7 and 8, and Ubuntu 12, 14, and 15 Installation Packages CPU Identifiers

        CPU ValueIntended Processor Type or Family
        i386Pentium processor or better, 32 bit
        amd6464-bit x86 processor


      • After downloading the tarball, unpack it with the following command:

        shell> tar -xvf mysql-server_MVER-DVER_CPU.deb-bundle.tar
        

      • In general, install the deb packages unpacked from the tarball with the command (see explanations below for the extra steps required for installing the server package):

        shell> sudo dpkg -i package-name.deb

        There are four packages to install:

        • The database common files (install this package before the other ones):

          shell> sudo dpkg -i mysql-common_MVER-DVER_CPU.deb

        • The MySQL server:

          Install first the package for the database common files (see the last bullet), and then pre-configure your server installation by the following command:

          shell> sudo dpkg-preconfigure mysql-community-server_MVER-DVER_CPU.deb

          You will be asked to provide a password for the root user for your MySQL installation. You might also be asked other questions regarding the installation.

          Important

          Make sure you remember the root password you set. Users who want to set a password later can leave the password field blank in the dialogue box and just press OK. However, it is very important that you set the password soon using the program mysql_secure_installation, as people can gain anonymous access to your MySQL server until you have secured the database's root account with a password.

          Next, install the server package with the following command:

          shell> sudo dpkg -i mysql-community-server_MVER-DVER_CPU.deb

        • The MySQL client:

          shell> sudo dpkg -i mysql-community-client_MVER-DVER_CPU.deb

        • The MySQL shared client library:

          shell> sudo dpkg -i libmysqlclient18_MVER-DVER_CPU.deb

        Here are where the files are installed on the system:

        • All configuration files (like my.cnf) are under /etc

        • All binaries, libraries, headers, etc., are under /usr

        • The data directory is under /var

    • For Debian 6:

      • Debian package files directly downloaded from the MySQL Developer Zone have names in the mysql-MVER-DVER-CPU.deb format. MVER is the MySQL version and DVER is the Debian version. The CPU value indicates the processor type or family for which the package is built, as shown in the following table:

        Table 2.10 MySQL Debian 6 Installation Package CPU Identifiers

        CPU ValueIntended Processor Type or Family
        i686Pentium processor or better, 32 bit
        x86_6464-bit x86 processor


      • After downloading a Debian package, use the following command to install it;

        shell> dpkg -i mysql-MVER-DVER-CPU.deb
        

        The Debian package installs files under the /opt/mysql/server-5.6 directory.

Note

Debian distributions of MySQL are also provided by other vendors. Be aware that they may differ from those built by Oracle in features, capabilities, and conventions (including communication setup), and that the instructions in this manual do not necessarily apply to installing them. The vendor's instructions should be consulted instead.


User Comments
  Posted by H J on September 11, 2016
Debian 8: The installation hangs during this installation step:

dpkg -i mysql-community-server_5.6.33-1debian8_amd64.deb

It hangs while doing: "Setting up mysql-community-server...", or specifically after "starting as process 7576 ...", as follows:

>>>
Selecting previously unselected package mysql-community-server.
(Reading database ... 203021 files and directories currently installed.)
Preparing to unpack mysql-community-server_5.6.33-1debian8_amd64.deb ...
Unpacking mysql-community-server (5.6.33-1debian8) ...
Setting up mysql-community-server (5.6.33-1debian8) ...
2016-09-11 09:55:06 0 [Note] /usr/sbin/mysqld (mysqld 5.6.33) starting as process 7526 ...
2016-09-11 09:55:09 0 [Note] /usr/sbin/mysqld (mysqld 5.6.33) starting as process 7550 ...
2016-09-11 09:55:12 0 [Note] mysqld (mysqld 5.6.33) starting as process 7576 ...
(HANGS HERE)
<<<

??Not sure why it appears to start mysqld 3 times.

(EDIT: SEE "WORKAROUND" AT BOTTOM of this comment)

--------
tip 1: if I'm running this from sudo there is no way to break out of this, short of closing the terminal window. But if I'm logged in as root via sudo -s, then I can break this deadlock with ^C, and then I get to following text to my screen:
--------

^Cdpkg: error processing package mysql-community-server (--install):
subprocess installed post-installation script was interrupted
Processing triggers for systemd (215-17+deb8u4) ...
Processing triggers for man-db (2.7.0.2-5) ...
Errors were encountered while processing:
mysql-community-server

--------
tip 2: Also if I issue "service mysql stop" from another terminal, the above installation will un-hang and issue the following:
--------

Job for mysql.service canceled.
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-community-server (--install):
subprocess installed post-installation script returned error exit status 1
Processing triggers for systemd (215-17+deb8u4) ...
Processing triggers for man-db (2.7.0.2-5) ...
Errors were encountered while processing:
mysql-community-server

--------
NOTE 1 - cat error.log gives (up until where it hangs):
--------

2016-09-11 10:29:30 17450 [Note] Plugin 'FEDERATED' is disabled.
2016-09-11 10:29:30 17450 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-09-11 10:29:30 17450 [Note] InnoDB: The InnoDB memory heap is disabled
2016-09-11 10:29:30 17450 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-09-11 10:29:30 17450 [Note] InnoDB: Memory barrier is not used
2016-09-11 10:29:30 17450 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-09-11 10:29:30 17450 [Note] InnoDB: Using Linux native AIO
2016-09-11 10:29:30 17450 [Note] InnoDB: Not using CPU crc32 instructions
2016-09-11 10:29:30 17450 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-09-11 10:29:30 17450 [Note] InnoDB: Completed initialization of buffer pool
2016-09-11 10:29:30 17450 [Note] InnoDB: Highest supported file format is Barracuda.
2016-09-11 10:29:30 17450 [Note] InnoDB: 128 rollback segment(s) are active.
2016-09-11 10:29:30 17450 [Note] InnoDB: Waiting for purge to start
2016-09-11 10:29:30 17450 [Note] InnoDB: 5.6.33 started; log sequence number 1626067
2016-09-11 10:29:30 17450 [Note] Binlog end
2016-09-11 10:29:30 17450 [Note] InnoDB: FTS optimize thread exiting.
2016-09-11 10:29:30 17450 [Note] InnoDB: Starting shutdown...
2016-09-11 10:29:32 17450 [Note] InnoDB: Shutdown completed; log sequence number 1626077
160911 10:29:33 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2016-09-11 10:29:33 0 [Note] /usr/sbin/mysqld (mysqld 5.6.33) starting as process 17801 ...
2016-09-11 10:29:33 17801 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5000)

2016-09-11 10:29:33 17801 [Warning] Buffered warning: Changed limits: table_open_cache: 431 (requested 2000)

2016-09-11 10:29:33 17801 [Note] Plugin 'FEDERATED' is disabled.
2016-09-11 10:29:33 17801 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-09-11 10:29:33 17801 [Note] InnoDB: The InnoDB memory heap is disabled
2016-09-11 10:29:33 17801 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-09-11 10:29:33 17801 [Note] InnoDB: Memory barrier is not used
2016-09-11 10:29:33 17801 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-09-11 10:29:33 17801 [Note] InnoDB: Using Linux native AIO
2016-09-11 10:29:33 17801 [Note] InnoDB: Not using CPU crc32 instructions
2016-09-11 10:29:33 17801 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-09-11 10:29:33 17801 [Note] InnoDB: Completed initialization of buffer pool
2016-09-11 10:29:33 17801 [Note] InnoDB: Highest supported file format is Barracuda.
2016-09-11 10:29:33 17801 [Note] InnoDB: 128 rollback segment(s) are active.
2016-09-11 10:29:33 17801 [Note] InnoDB: Waiting for purge to start
2016-09-11 10:29:33 17801 [Note] InnoDB: 5.6.33 started; log sequence number 1626077
2016-09-11 10:29:33 17801 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2016-09-11 10:29:33 17801 [Note] - '127.0.0.1' resolves to '127.0.0.1';
2016-09-11 10:29:33 17801 [Note] Server socket created on IP: '127.0.0.1'.
2016-09-11 10:29:33 17801 [Note] Event Scheduler: Loaded 0 events
2016-09-11 10:29:33 17801 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.33' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)

--------
NOTE 2 - after "server mysql stop" is issued, cat error.log now adds:
--------

2016-09-11 10:34:24 17801 [Note] /usr/sbin/mysqld: Normal shutdown

2016-09-11 10:34:24 17801 [Note] Giving 0 client threads a chance to die gracefully
2016-09-11 10:34:24 17801 [Note] Event Scheduler: Purging the queue. 0 events
2016-09-11 10:34:24 17801 [Note] Shutting down slave threads
2016-09-11 10:34:24 17801 [Note] Forcefully disconnecting 0 remaining clients
2016-09-11 10:34:24 17801 [Note] Binlog end
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'partition'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_METRICS'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_CMPMEM'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_CMP'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_LOCKS'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'INNODB_TRX'
2016-09-11 10:34:24 17801 [Note] Shutting down plugin 'InnoDB'
2016-09-11 10:34:24 17801 [Note] InnoDB: FTS optimize thread exiting.
2016-09-11 10:34:24 17801 [Note] InnoDB: Starting shutdown...
2016-09-11 10:34:26 17801 [Note] InnoDB: Shutdown completed; log sequence number 1626087
2016-09-11 10:34:26 17801 [Note] Shutting down plugin 'BLACKHOLE'
2016-09-11 10:34:26 17801 [Note] Shutting down plugin 'ARCHIVE'
2016-09-11 10:34:26 17801 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2016-09-11 10:34:26 17801 [Note] Shutting down plugin 'MEMORY'
2016-09-11 10:34:26 17801 [Note] Shutting down plugin 'MyISAM'
2016-09-11 10:34:26 17801 [Note] Shutting down plugin 'MRG_MYISAM'
2016-09-11 10:34:26 17801 [Note] Shutting down plugin 'CSV'
2016-09-11 10:34:26 17801 [Note] Shutting down plugin 'sha256_password'
2016-09-11 10:34:26 17801 [Note] Shutting down plugin 'mysql_old_password'
2016-09-11 10:34:26 17801 [Note] Shutting down plugin 'mysql_native_password'
2016-09-11 10:34:26 17801 [Note] Shutting down plugin 'binlog'
2016-09-11 10:34:26 17801 [Note] /usr/sbin/mysqld: Shutdown complete

160911 10:34:27 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

==========
WORKAROUND
==========

After breaking the stuck installation above (either with ^C or "server mysql stop") you can then continue the installation above, i.e.:

sudo dpkg -i mysql-community-client_MVER-DVER_CPU.deb
sudo dpkg -i libmysqlclient18_MVER-DVER_CPU.deb

Then you can test the client with:

mysql --help

And open the client as follows:

mysql -h localhost -u root -p
Enter password: xxxx

or

mysql -u root -p
Enter password: xxxx

And then issue the following commands to see that the server and client are basically working:

mysql> SELECT VERSION(), CURRENT_DATE;
+-----------+--------------+
| VERSION() | CURRENT_DATE |
+-----------+--------------+
| 5.6.33 | 2016-09-11 |
+-----------+--------------+
1 row in set (0.00 sec)

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)

###############
FINALLY
###############
If I re-run the install that would hang before, i.e.

dpkg -i mysql-community-server_5.6.33-1debian8_amd64.deb

Now it does not hang!

>>>
(Reading database ... 203182 files and directories currently installed.)
Preparing to unpack mysql-community-server_5.6.33-1debian8_amd64.deb ...
.
Unpacking mysql-community-server (5.6.33-1debian8) over (5.6.33-1debian8) ...
Setting up mysql-community-server (5.6.33-1debian8) ...
2016-09-11 11:35:34 0 [Note] mysqld (mysqld 5.6.33) starting as process 3082 ...
Processing triggers for systemd (215-17+deb8u4) ...
Processing triggers for man-db (2.7.0.2-5) ...
<<<
Sign Up Login You must be logged in to post a comment.