# Mysql on ubuntu data source setup issue

**URL:** <https://dev.lucee.org/t/mysql-on-ubuntu-data-source-setup-issue/6440>\
**Category:** support\
**Created:** [January 8, 2020, 6:32pm UTC](https://dev.lucee.org/t/mysql-on-ubuntu-data-source-setup-issue/6440 "2020-01-08T18:32:56Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![justaguy](https://dev.lucee.org/letter_avatar_proxy/v4/letter/j/d9b06d/32.png) [@justaguy](https://dev.lucee.org/u/justaguy)\
**Post date:** [January 8, 2020, 6:32pm UTC](https://dev.lucee.org/t/mysql-on-ubuntu-data-source-setup-issue/6440/1 "2020-01-08T18:32:56Z")

</div>

i just installed mysql for ubuntu and created a test db, however, setting up a data source via lucee failed.  
err msg:  
"

> Communications link failure
> 
> The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server."

Here are some key info:  
host/server:localhost  
port:3306

verification: show global variables like ‘port’;  
indicates that mysql is running at port 3306.

What could be wrong?  
thanks.

---

<div class="post-metadata">

**Author:** ![andreas](https://dev.lucee.org/user_avatar/dev.lucee.org/andreas/32/3352_2.png) [@andreas](https://dev.lucee.org/u/andreas)\
**Post date:** [January 9, 2020, 12:35am UTC](https://dev.lucee.org/t/mysql-on-ubuntu-data-source-setup-issue/6440/2 "2020-01-09T00:35:54Z")

</div>

Hi, have you checked your firewall settings? What happens when you try to connect with another mysql client from the same machine? Are you able to connect to it?

---

<div class="post-metadata">

**Author:** ![justaguy](https://dev.lucee.org/letter_avatar_proxy/v4/letter/j/d9b06d/32.png) [@justaguy](https://dev.lucee.org/u/justaguy)\
**Post date:** [January 9, 2020, 12:54am UTC](https://dev.lucee.org/t/mysql-on-ubuntu-data-source-setup-issue/6440/3 "2020-01-09T00:54:35Z")

</div>

Yeah, sql client access to the mysql server and databases on it was fine.  
Any test that I can run to verify it’s firewall issue?  
Thanks.

---

<div class="post-metadata">

**Author:** ![andreas](https://dev.lucee.org/user_avatar/dev.lucee.org/andreas/32/3352_2.png) [@andreas](https://dev.lucee.org/u/andreas)\
**Post date:** [January 10, 2020, 2:37am UTC](https://dev.lucee.org/t/mysql-on-ubuntu-data-source-setup-issue/6440/4 "2020-01-10T02:37:21Z")

</div>

It really can be a lot of things. If it isn’t the firewall, maybe your mysqld is bound to an ip-address within the my.cnf? And the datasource you are creating inside lucess server administrator is trying to connect to your external IP-Address? To check open a terminal and do a:

`sudo ss -ltnp|grep mysql`.

What response do you see?  
`127.0.0.1:3306`  
or  
`0.0.0.0:3306`  
or your  
`externalIP:3306` ?

---

<div class="post-metadata">

**Author:** ![justaguy](https://dev.lucee.org/letter_avatar_proxy/v4/letter/j/d9b06d/32.png) [@justaguy](https://dev.lucee.org/u/justaguy)\
**Post date:** [January 10, 2020, 3:14am UTC](https://dev.lucee.org/t/mysql-on-ubuntu-data-source-setup-issue/6440/5 "2020-01-10T03:14:57Z")

</div>

> [@andreas](#):
>
> sudo ss -ltnp|grep mysql

This is what is returned:

> LISTEN 0 80 127.0.0.1:3306 _:_ users:((“mysqld”,pid=18294,fd=20))

In addition, my current mysql configuration seems empty, both the my.cnf and mysql.cnf file under /etc/mysql directory has the following content in addition to multiple lines of comments:

!includedir /etc/mysql/conf.d/  
!includedir /etc/mysql/mysql.conf.d/

* * *

These two directories seem to have been excluded. In the meantime, the /etc/mysql/mysql.conf.d/ directory seems to have a meaningful configuration file such as

> bind-address = 127.0.0.1

For the data source setup, I tried “localhost” and “127.0.0.1” respectively for “host/server” to no avail.  
What else could I try?  
Thanks.

---

<div class="post-metadata">

**Author:** ![andreas](https://dev.lucee.org/user_avatar/dev.lucee.org/andreas/32/3352_2.png) [@andreas](https://dev.lucee.org/u/andreas)\
**Post date:** [January 10, 2020, 3:24am UTC](https://dev.lucee.org/t/mysql-on-ubuntu-data-source-setup-issue/6440/6 "2020-01-10T03:24:27Z")

</div>

Do you have lucee running on a different machine than your mysql server?

Also… when you are setting up the datasource are you connecting to “localhost” or to a specific IP-Address that is not 127.0.0.1?

---

<div class="post-metadata">

**Author:** ![andreas](https://dev.lucee.org/user_avatar/dev.lucee.org/andreas/32/3352_2.png) [@andreas](https://dev.lucee.org/u/andreas)\
**Post date:** [January 10, 2020, 3:29am UTC](https://dev.lucee.org/t/mysql-on-ubuntu-data-source-setup-issue/6440/7 "2020-01-10T03:29:48Z")

</div>

> [@justaguy](#):
>
> bind-address = 127.0.0.1

You can try changing that to:  
`bind-address = 0.0.0.0`  
resttart mysql

**BUT WATCH OUT:** By doing this you will probably open mysql over the internet for everybody if you don’t set up a proper firewall rule.

---

<div class="post-metadata">

**Author:** ![derrickpeavy](https://dev.lucee.org/user_avatar/dev.lucee.org/derrickpeavy/32/2044_2.png) [@derrickpeavy](https://dev.lucee.org/u/derrickpeavy)\
**Post date:** [January 10, 2020, 1:38pm UTC](https://dev.lucee.org/t/mysql-on-ubuntu-data-source-setup-issue/6440/8 "2020-01-10T13:38:46Z")

</div>

> [@andreas](#):
>
> **WATCH OUT:** By doing this you will probably open mysql over the internet for everybody if you don’t set up a

I am running Ubuntu 18.04 LTS in a couple of places, MySQL 8, Lucee 5.x.x.x and over Tomcat and Apache. If any of my settings can help, I am happy to share.

Also, if you running Tomcat, make sure that you give the WEB-INF folder to tomcat (chown -R tomcat:tomcat).

I’ve also included a MySQL 8.0.18 driver which I recently put together with a lot of help from other people here. You are welcome to use (add through Lucee admin). This community has been very helpful, if I can give back, happy to.

[com.mysql.cj-8.0.16.lex](https://dev.lucee.org/uploads/short-url/jpgJ2jn9UBYSAiei1N1rp9CXvFK.lex) (2.1 MB)

---

<div class="post-metadata">

**Author:** ![justaguy](https://dev.lucee.org/letter_avatar_proxy/v4/letter/j/d9b06d/32.png) [@justaguy](https://dev.lucee.org/u/justaguy)\
**Post date:** [January 10, 2020, 3:50pm UTC](https://dev.lucee.org/t/mysql-on-ubuntu-data-source-setup-issue/6440/9 "2020-01-10T15:50:17Z")

</div>

> `bind-address = 0.0.0.0`  
> resttart mysql

done to no effect, ds setup still failed with same err msg.

how do I know which configuration file is being used? Thanks.

---

<div class="post-metadata">

**Author:** ![justaguy](https://dev.lucee.org/letter_avatar_proxy/v4/letter/j/d9b06d/32.png) [@justaguy](https://dev.lucee.org/u/justaguy)\
**Post date:** [January 10, 2020, 3:53pm UTC](https://dev.lucee.org/t/mysql-on-ubuntu-data-source-setup-issue/6440/10 "2020-01-10T15:53:50Z")

</div>

I’d prefer to keep it as simple as possible, that is, just Lucee and mysql ( 5.7.28-0ubuntu0.16.04.2 ),

---

<div class="post-metadata">

**Author:** ![andreas](https://dev.lucee.org/user_avatar/dev.lucee.org/andreas/32/3352_2.png) [@andreas](https://dev.lucee.org/u/andreas)\
**Post date:** [January 10, 2020, 5:47pm UTC](https://dev.lucee.org/t/mysql-on-ubuntu-data-source-setup-issue/6440/11 "2020-01-10T17:47:27Z")

</div>

It is too dificult to predict this from remote.

I did a fresh install with ubuntu 18.04 LTS, latest stable Lucee with Linux Installer and MariaDB (actual default MariaDB Version), without any issue.

Further reading for your problem you may find here:

> <https://stackoverflow.com/questions/6865538/solving-a-communications-link-failure-with-jdbc-and-mysql>

---

<div class="post-metadata">

**Author:** ![justaguy](https://dev.lucee.org/letter_avatar_proxy/v4/letter/j/d9b06d/32.png) [@justaguy](https://dev.lucee.org/u/justaguy)\
**Post date:** [January 10, 2020, 9:03pm UTC](https://dev.lucee.org/t/mysql-on-ubuntu-data-source-setup-issue/6440/12 "2020-01-10T21:03:20Z")

</div>

I appreciate the info. Is it easy to upgrade my current Lucee version on ubuntu 16.04 to its latest stable version?

---

<div class="post-metadata">

**Author:** ![andreas](https://dev.lucee.org/user_avatar/dev.lucee.org/andreas/32/3352_2.png) [@andreas](https://dev.lucee.org/u/andreas)\
**Post date:** [January 12, 2020, 2:15am UTC](https://dev.lucee.org/t/mysql-on-ubuntu-data-source-setup-issue/6440/13 "2020-01-12T02:15:18Z")

</div>

I really can’t say, because I am totally new to linux. I come from windows and I am learing about Linux/Ubuntu thankfully/gratefully motivated by some users of this forum. I still didn’t get to this point because I am still on phase of experimenting/hardening/finding the best configuration that works for me on a VPS. But upgrading is on my checklist just like desasterrecovery & backup. But I think that is not very different than on windows because its JAVA: it should only be a backup and a jar-file replacement.

---

<div class="post-metadata">

**Author:** ![andreas](https://dev.lucee.org/user_avatar/dev.lucee.org/andreas/32/3352_2.png) [@andreas](https://dev.lucee.org/u/andreas)\
**Post date:** [January 12, 2020, 2:20am UTC](https://dev.lucee.org/t/mysql-on-ubuntu-data-source-setup-issue/6440/14 "2020-01-12T02:20:58Z")

</div>

See:

> **[Upgrading from Lucee 4.5 :: Lucee Documentation](https://docs.lucee.org/guides/lucee-5/upgrading-lucee-45.html)**
>
> Upgrade from Lucee 4.5 (or Railo 4.2) Before starting the upgrade, please check the bundled versions of Java and Tomcat you have installed. These older versions of Lucee/Railo were released several years ago (2014/2015) and the bundled versions of...

---

<div class="post-metadata">

**Author:** ![justaguy](https://dev.lucee.org/letter_avatar_proxy/v4/letter/j/d9b06d/32.png) [@justaguy](https://dev.lucee.org/u/justaguy)\
**Post date:** [January 13, 2020, 3:01am UTC](https://dev.lucee.org/t/mysql-on-ubuntu-data-source-setup-issue/6440/15 "2020-01-13T03:01:01Z")

</div>

Ok, thanks for the note.

---

<div class="post-metadata">

**Author:** ![justaguy](https://dev.lucee.org/letter_avatar_proxy/v4/letter/j/d9b06d/32.png) [@justaguy](https://dev.lucee.org/u/justaguy)\
**Post date:** [January 13, 2020, 3:01am UTC](https://dev.lucee.org/t/mysql-on-ubuntu-data-source-setup-issue/6440/16 "2020-01-13T03:01:33Z")

</div>

I appreciate the lucee upgrade info.

---

<div class="post-metadata">

**Author:** ![justaguy](https://dev.lucee.org/letter_avatar_proxy/v4/letter/j/d9b06d/32.png) [@justaguy](https://dev.lucee.org/u/justaguy)\
**Post date:** [January 13, 2020, 4:32pm UTC](https://dev.lucee.org/t/mysql-on-ubuntu-data-source-setup-issue/6440/17 "2020-01-13T16:32:22Z")

</div>

> [@andreas](#):
>
> MariaDB

@andreas I have several questions about MariaDB.

1. I have never used MariaDB but I consider myself reasonably good at relational dbms. Found the following info about it.  
**MariaDB** Server is one of the most popular open source relational databases. It’s made by the original developers of MySQL and guaranteed to stay open source. \*\*
2. We have a centOS Linux version 7 box. Would the latest Lucee docker image have a driver for MariaDB for this OS?
3. If the above 2) is true, in the future if we need to export MariaDB to other dbms such as MS SQL Server, would that be doable? If so, how easy or how difficult it might be?

Many thanks.

---

<div class="post-metadata">

**Author:** ![andreas](https://dev.lucee.org/user_avatar/dev.lucee.org/andreas/32/3352_2.png) [@andreas](https://dev.lucee.org/u/andreas)\
**Post date:** [January 13, 2020, 7:33pm UTC](https://dev.lucee.org/t/mysql-on-ubuntu-data-source-setup-issue/6440/18 "2020-01-13T19:33:28Z")

</div>

@justaguy

MariaDB is a fork of MySQL and was built by the creators of MySQL before selling it to Sun Microsystems. It was built to ensue a drop-in replacement capability with MySQL (comparable with Lucee/Railo in relation to Adobe CF). When I switched in 2012 it was pretty easy, because everything worked all alike. At that time I felt like I was using MySQL, but with a different name. Not only the engines are alike, also the config files/directives, SQL, use of HeidiSQL worked all the same. You can export import DBases with mysqldump from one to the other. So the drivers you use are the mysql-drivers. Switching to MS SQL should be pretty the same like switching from MySQL.

If you experiencing problems with MySQL you’ll probably have the same issues with MariaDB. especially when you are using old software/drivers. Better check that first.
