How do I set up Concluence to use our MySQL database? Instructions seem to be missing info.
Asked by Steven Vervais:

I'm following the instructions on

Ref:

<https://confluence.atlassian.com/doc/database-setup-for-mysql-128747.html>

which says  

2. Configure MySQL Server  

"Note: If you intend to connect Confluence to an existing MySQL database server, we strongly recommend that you reconfigure this database server by running through the configuration steps in the MySQL installation wizard as described below.  

"To configure MySQL Server:  

Run the MySQL installation wizard:  
If you are connecting Confluence to your existing MySQL server, choose Reconfigure Instance."  

When I installed MySQL 8, folowing the links and instructions in Ref, it never gave me an opportunity to do all the choices required by Ref, and now I am stuck at this page, unable to succeed with Test connection, or even to know what to put in the several blanks:  
http://localhost:8090/setup/setupdbtype-start.action

I tried various possibilities, but all fail with something like

SQLState - 28000  
Error Code - 1698  
java.sql.SQLException: Access denied for user 'root'@'localhost'

I tried to learn how to re-start the MySQL installer, as recommended on several pages in the MySQL 8 Reference Manual, and nowhere do I find a specific command to do so. Likewise I see no opportunity to "choose Reconfigure Instance" as instructed in Ref.

MySQL is running, and the command /usr/bin/mysqlshow replies with  
+---------------------------------+  
\| Databases \|  
+----------------------------------+  
\| information_schema \|  
\| mysql \|  
\| performance_schema \|  
\| sys \|  
+----------------------------------+


Answers:
author: Francesc Arb?
body: Hi [@Steven Vervais](/t5/user/viewprofilepage/user-id/1313171),

when you say you have installed MySQL 8 what do you mean? According to Atlassian, Confluence supports versions MySQL 5.6 and MySQL 5.7.

comments: author: James Harris
body: I'm Jim Harris, the lead for IT Infrastructure at Steve's org. I am the one doing all the work on this setup of Atlassian products on our Ubuntu 18.04 server.

Per the original post in this thread, I followed the instructions in Ref, which led me to MySQL 8. This is a recent change.


author: Steven Vervais
body: This is Jim again.

On searching further, given your additional info to use for keywords, I see probably what you refer to:

<https://confluence.atlassian.com/doc/supported-platforms-207488198.html>

says MySQL 5.6 or 5.7.

I hope the Confluence setup instructions

<https://confluence.atlassian.com/doc/database-setup-for-mysql-128747.html>

can be improved by adding a link early on that page (I hope I didn't miss it) to refer to the current supported platforms page.

But now I still have the problems of not knowing how to:

(1) completely remove the wrong MySQL, and

(2) install the correct one, and

(3) find the option to "choose Reconfigure Instance" as instructed in Ref.

I will keep digging, but if anyone knows where those instructions are, I would appreciate a link.


author: Steven Vervais
body: OK, for several hours now I have descended into MySQL and PostgreSQL hell. I have found and followed the instructions to remove MySQL 8 (which seem to have worked) and install MySQL 5.7 (which fails with a missing dependency on mysql-community which I cannot resolve by installing same), and I cannot find any way to install PostgresQL 9.6 (or 9.5, ...) on Ubuntu 18.04; all attempts only install PostgreSQL 10.

I have searched, found, and followed several different methods, all of which fail.

Come on, Atlassian, _please_ give us some MySQL _and_ PostgreSQL installation and configuration instructions that _actually_work_ to allow continuing installation of Confluence.


author: Nic Brough -Adaptavist-
body: To be fair, you're now struggling with operating system vs required database problems, not Atlassian software vs OS or DB, and you can't expect them to document it for everything (there are 100s of Linux variations out there. My home systems have no problem installing postgres on a Pi).

On the Ubuntu 18 I do have access to, apt-get install postgres-9.6 seems healthy.


author: Steven Vervais
body: Yes, that's true, of course. But Ubuntu is one of the favorites and should work the same as essentially all the Debian-based Linuxen. When I saw your post, I was about to write: "I wonder, has anyone successfully done a MySQL 5.7 or PostgreSQL 9.6 fresh install on Ubuntu 18.04 LTS Desktop, preparatory to a Confluence install, all 64-bit?" Then I noticed that your install command said " postgres-9.6" where I had tried postgres9.6 and got nothing but "can't find ..." errors looking in various repos. So I tried yours, and it tried really hard to work, but failed with errors related to mysql-community-server, such as:

Setting up mysql-community-server (5.7.22-1ubuntu18.04) ...  
Job for mysql.service failed because the control process exited with error code.  
See "systemctl status mysql.service" and "journalctl -xe" for details.  
invoke-rc.d: initscript mysql, action "start" failed.

I think I will sudo apt-get remove --purge mysql-server, mysql-community-server, and postgres-9.6, and re-try. Do you know why a PostgreSQL installer would invoke anything about MySQL?


author: Nic Brough -Adaptavist-
body: When an apt-command fails, it can leave the package database in a funny place, where the next apt-command will try to continue where the last one left off.

So, if you've just failed to install MySQL, and you run apt-get install postgres-9.6, then apt may well report trying to do things with MySQL.

You've got absolutely the right idea, try to clean this stuff up before retrying the PostGreSQL install. I'd also go for "apt-get autoremove" and "apt-get -f install" to see what is jammed up and use "remove" on that package to remove it from the list.


author: James Harris
body: Well, that is good to know; thanks, Nic. I thought something was messed up, so I just re-installed Ubuntu 18.04 Desktop 64-bit from my verified USB stick, since I had nothing installed on it anyway, so I knew I had a clean slate for trying PostgreSQL install again.

So now I have spent another very frustrating 8 hours working on this, and I've learned a lot about /etc/apt/sources.list, and I got a couple entries in it that now show as checked in the app Ubuntu Software \>\> Software and Updates \>\> Other Software:

deb <https://apt.postgresql.org/pub/repos/apt/dists/bionic-pgdg/> 9.6 binary-amd64  
deb <https://apt.postgresql.org/pub/repos/apt/dists/> bionic-pgdg 9.6

and when I copy and paste the displayed info for either of them from the Other Software screen, this is what I get:

<https://apt.postgresql.org/pub/repos/apt/dists/bionic-pgdg/9.6/binary-amd64/>

and then I upgrade with --allow-unauthenticated because without it I get errors saying there is no Release and/or the repo is unauthenticated/unsigned:

jim@JGist-Server-1:\~$ sudo apt-get --allow-unauthenticated upgrade  
\[sudo\] password for jim:  
Reading package lists... Done  
Building dependency tree  
Reading state information... Done  
Calculating upgrade... Done  
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.  
jim@JGist-Server-1:\~$

And, after all this, I still get:

jim@JGist-Server-1:\~$ sudo apt install postgresql-9.6  
Reading package lists... Done  
Building dependency tree  
Reading state information... Done  
Package postgresql-9.6 is not available, but is referred to by another package.  
This may mean that the package is missing, has been obsoleted, or  
is only available from another source

E: Package 'postgresql-9.6' has no installation candidate  
jim@JGist-Server-1:\~$

Can we please get Atlassian Support to look into this? I can't install Confluence because their _recommended_ database won't install. I don't know how to get them to look at this. I also have hundreds of lines of saved terminal sessions showing all the errors and everything I've tried, and I don't know how to provide it to them.


author: James Harris
body: Well, at least I learned that I can post to this thread logged in as myself (the post a couple minutes ago is also mine, as are all the ones that say Steve Vervais).


author: Nic Brough -Adaptavist-
body: Atlassian are unlikely to look at this, the problem is installing a database on a server, neither of which they wrote.

I may have amended the sources file on my server (I don't think I did, but it is possible).

Could you try

apt-cache search postgresql

If that's a bit long and has loads of hits that don't directly look related, try adding \| grep "postgresql-" to it


author: James Harris
body: Thanks for trying to help, Nic.

Here ya go:

jim@JGist-Server-1:\~$ apt-cache search postgresql \| grep "postgresql-"  
postgresql-10 - object-relational SQL database, version 10 server  
postgresql-client - front-end programs for PostgreSQL (supported version)  
postgresql-client-10 - front-end programs for PostgreSQL 10  
postgresql-client-common - manager for multiple PostgreSQL client versions  
postgresql-common - PostgreSQL database-cluster manager  
postgresql-contrib - additional facilities for PostgreSQL (supported version)  
postgresql-doc - documentation for the PostgreSQL database management system  
postgresql-doc-10 - documentation for the PostgreSQL database management system  
postgresql-plperl-10 - PL/Perl procedural language for PostgreSQL 10  
postgresql-plpython-10 - PL/Python procedural language for PostgreSQL 10  
postgresql-plpython3-10 - PL/Python 3 procedural language for PostgreSQL 10  
postgresql-pltcl-10 - PL/Tcl procedural language for PostgreSQL 10  
cl-sql-postgresql-socket - CLSQL database backend, PostgreSQL via sockets  
gnustep-dl2-postgresql-adaptor - gnustep-dl2 adaptor to connect to PostgreSQL  
kexi-postgresql-driver - PostgreSQL support for kexi  
libghc-hdbc-postgresql-dev - PostgreSQL HDBC (Haskell Database Connectivity) Driver for GHC  
libghc-hdbc-postgresql-doc - PostgreSQL HDBC (Haskell Database Connectivity) documentation  
libghc-hdbc-postgresql-prof - PostgreSQL HDBC Driver for GHC; profiling libraries  
libghc-persistent-postgresql-dev - backend for the persistent library using PostgreSQL  
libghc-persistent-postgresql-doc - backend for the persistent library using PostgreSQL; documentation  
libghc-persistent-postgresql-prof - backend for the persistent library using PostgreSQL; profiling libraries  
libghc-postgresql-libpq-dev - low-level binding to libpq  
libghc-postgresql-libpq-doc - low-level binding to libpq; documentation  
libghc-postgresql-libpq-prof - low-level binding to libpq; profiling libraries  
libghc-postgresql-simple-dev - mid-level PostgreSQL client library  
libghc-postgresql-simple-doc - mid-level PostgreSQL client library; documentation  
libghc-postgresql-simple-prof - mid-level PostgreSQL client library; profiling libraries  
libghc-text-postgresql-dev - Parser and Printer of PostgreSQL extended types  
libghc-text-postgresql-doc - Parser and Printer of PostgreSQL extended types; documentation  
libghc-text-postgresql-prof - Parser and Printer of PostgreSQL extended types; profiling libraries  
libpostgresql-gst - PostgreSQL bindings for GNU Smalltalk  
libpostgresql-jdbc-java - Java database (JDBC) driver for PostgreSQL  
libpostgresql-jdbc-java-doc - Java database (JDBC) driver for PostgreSQL (documentation)  
libpostgresql-ocaml - OCaml bindings to PostgreSQL's libpq (runtime)  
libpostgresql-ocaml-dev - OCaml bindings to PostgreSQL's libpq  
libtest-postgresql-perl - sets up and destroys temporary PostgreSQL instances for testing  
lua-dbi-postgresql-dbg - DBI library for the Lua language, PostgreSQL backend debug symbols  
lua-dbi-postgresql-dev - DBI library for the Lua language, PostgreSQL development files  
postgresql-10-amcheck - PostgreSQL extension that verifies indexes  
postgresql-10-asn1oid - ASN.1 OID data type for PostgreSQL  
postgresql-10-bgw-replstatus - report whether PostgreSQL node is master or standby  
postgresql-10-citus - sharding and distributed joins for PostgreSQL  
postgresql-10-cron - Run periodic jobs in PostgreSQL  
postgresql-10-debversion - Debian version number type for PostgreSQL  
postgresql-10-dirtyread - Read dead but unvacuumed tuples from a PostgreSQL relation  
postgresql-10-ip4r - IPv4 and IPv6 types for PostgreSQL 10  
postgresql-10-jsquery - PostgreSQL JSON query language with GIN indexing support  
postgresql-10-mimeo - specialized, per-table replication between PostgreSQL instances  
postgresql-10-mysql-fdw - Postgres 10 Foreign Data Wrapper for MySQL  
postgresql-10-ogr-fdw - PostgreSQL foreign data wrapper for OGR  
postgresql-10-orafce - Oracle support functions for PostgreSQL 10  
postgresql-10-partman - PostgreSQL Partition Manager  
postgresql-10-pgaudit - PostgreSQL Audit Extension  
postgresql-10-pgextwlist - PostgreSQL Extension Whitelisting  
postgresql-10-pgfincore - set of PostgreSQL functions to manage blocks in memory  
postgresql-10-pglogical - Logical Replication Extension for PostgreSQL  
postgresql-10-pgmemcache - PostgreSQL interface to memcached  
postgresql-10-pgmp - arbitrary precision integers and rationals for PostgreSQL 10  
postgresql-10-pgq-node - Cascaded queueing on top of PgQ  
postgresql-10-pgq3 - Generic queue for PostgreSQL  
postgresql-10-pgrouting - Routing functionality support for PostgreSQL/PostGIS  
postgresql-10-pgrouting-doc - Routing functionality support for PostgreSQL/PostGIS (Documentation)  
postgresql-10-pgrouting-scripts - Routing functionality support for PostgreSQL/PostGIS - SQL scripts  
postgresql-10-pgtap - Unit testing framework extension for PostgreSQL 10  
postgresql-10-pldebugger - PostgreSQL pl/pgsql Debugger API  
postgresql-10-pllua - Lua procedural language for PostgreSQL 10  
postgresql-10-plproxy - database partitioning system for PostgreSQL 10  
postgresql-10-plr - Procedural language interface between PostgreSQL and R  
postgresql-10-plsh - PL/sh procedural language for PostgreSQL 10  
postgresql-10-plv8 - Procedural language interface between PostgreSQL and JavaScript  
postgresql-10-postgis-2.4 - Geographic objects support for PostgreSQL 10  
postgresql-10-postgis-2.4-scripts - Geographic objects support for PostgreSQL 10 -- SQL scripts  
postgresql-10-postgis-scripts - transitional dummy package  
postgresql-10-powa - PostgreSQL Workload Analyzer -- PostgreSQL 10 extension  
postgresql-10-prefix - Prefix Range module for PostgreSQL  
postgresql-10-preprepare - pre prepare your PostgreSQL statements server side  
postgresql-10-prioritize - Get and set the nice priorities of PostgreSQL backends  
postgresql-10-python-multicorn - multicorn extension for Postgres 10 to write FDWs with python2  
postgresql-10-python3-multicorn - multicorn extension for Postgres 10 to write FDWs with python3  
postgresql-10-repack - reorganize tables in PostgreSQL databases with minimal locks  
postgresql-10-repmgr - replication manager for PostgreSQL 10  
postgresql-10-rum - PostgreSQL RUM access method  
postgresql-10-similarity - PostgreSQL similarity functions extension  
postgresql-10-slony1-2 - replication system for PostgreSQL: PostgreSQL 10 server plug-in  
postgresql-10-unit - SI Units for PostgreSQL  
postgresql-all - metapackage depending on all PostgreSQL server packages  
postgresql-autodoc - Utility to create a PostgreSQL database schema overview in HTML, DOT and XML  
postgresql-comparator - efficient PostgreSQL table content comparison and synchronization  
postgresql-filedump - Utility to format PostgreSQL files  
postgresql-hll - HyperLogLog extension for PostgreSQL  
postgresql-pgsphere - Spherical data types for PostgreSQL  
postgresql-q3c - PostgreSQL extension used for indexing the sky  
postgresql-server-dev-10 - development files for PostgreSQL 10 server-side programming  
postgresql-server-dev-all - extension build tool for multiple PostgreSQL versions  
python-multicorn - multicorn utility module for postgresql-X.Y-python-multicorn  
python3-multicorn - multicorn utility module for postgresql-X.Y-python3-multicorn  
tarantool-lts-postgresql-module - Tarantool in-memory database - PostgreSQL connector  
jim@JGist-Server-1:\~$

I wonder if Postgres 10 is _already_installed_ in Ubuntu 18.04 Desktop, so I should remove --purge all postgres stuff before trying to install 9.6.

I still don't think that would explain the message, "E: Package 'postgresql-9.6' has no installation candidate", though.


author: James Harris
body: And of course you are right: Atlassian wrote neither Ubuntu nor Postgres, but you'd think they must have tested Confluence on something recent and Debian, and Postgres 9.6, if that's what they recommend, and in order to test it, they must have installed it, and whoever installed it probably has the logs and other records of how it was done ...


author: James Harris
body: I'm thinking I will look for a Postgres forum and ask, "has anyone successfully done a PostgreSQL 9.6 fresh install on Ubuntu 18.04 LTS Desktop, and if yes, how did you do it?". And for good measure, I can do the same thing for MySQL 5.7. What do you think?


author: Nic Brough -Adaptavist-
body: Definitely worth asking.

I'm now certain I must have hacked my sources list on the box I was looking at, possibly not for that reason (my actual database server is not Ubuntu)


author: James Harris
body: I found the problem and the solution, and I think I posted that fact, but I don't see that post now, and all I have available for the next few days is a smart phone which doesn't seem to be helping me at the moment. Thanks for all your help, and I will try to clarify when I can get to a real computer, probably which will not occur before Sunday afternoon.


Tags: confluence-server

mysql

server