I find it hard to establish a link between jdbc and mysql. I think one of the reasons is the mysql port. I checked the port with the statement: \"show variables like \'port\';\"
You can change the port number in the MySQL config file: my.cnf
On my ubuntu install, in /etc/mysql/my.cnf theres a line that says :
[mysqld]
port = 3306
<snip...>
Try changing this value accordingly and restarting mysql.
Hope it works for you.
First of all check what SHOW VARIABLES LIKE 'skip_networking';
if it reports skip_networking = On, your mysqld is started without networking support (which leads to an value of 0 in the port system variable).
If this is the case, you most likely have to check the init scripts for your mysqld, its most likely under /etc/init.d/mysql
, search here for --skip-networking
and comment out (delete) this part. After this procedure you have to restart your mysqld.
Normaly there is no need to set the port 3306 explicitly since 3306 is the default port for mjysqld to listen on.
allow remote connection fixed, didn't change " GLOBAL VARIABLES LIKE 'PORT';" edit my.cnf /etc/my.cnf
[mysqld]
user = mysql
basedir = /usr
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/English
bind-address = 65.55.55.2
# your mysql server ip address should place in bind-address
# skip-networking
restart the mysql service
You need to change this value from mysql configuration file. Steps are:
To go to related file: sudo nano /etc/mysql/my.cnf
To search for related line:(for Win, Linux) ctrl + w
, (for Mac) cmd + w
port = 0
(look for twice for [client] and [mysqld] sections)
port = 3306
ctrl + x , cmd + x y
sudo service mysql restart
You need to edit your mysql config file, my.cnf in /etc/my.cnf and change the port to 3306. Then restart mysql.
Source: http://www.cyberciti.biz/faq/change-default-mysql-port-under-linuxunix/
Edit:
This website might help you a bit more for your specific platform: https://wiki.archlinux.org/index.php/MySQL#Configuration
It has a portion talking about copying over your my.cnf file:
Copy your choice of config file:
# cp /usr/local/mysql/support-files/my-medium.cnf /usr/local/mysql/data/my.cnf