JDBC and MySQL on Slackware

Many people had this problem with MySQL “refusing” JDBC connections on all the distros.

The trick is, that by default MySQL is configured with the ’skip-networking’ property in my.cnf. If you want JDBC to work you will have to disable it.

But, there’s another trick, on Slackware for example there’s the ‘–skip-networking’ switch enabled by default in /etc/rc.d/rc.mysqld , so you will have to comment out the line defining the ‘SKIP’ variable.

skip-networking disables MySQL’s tcp socket listener and leaves only the Unix socket open. JDBC on the other hand connects only trough tcp sockets, so that’s the problem.

To be sure that skip-networking is disabled it is better to take a look in all MySQL related scripts, configs and other files.

2 Responses to “JDBC and MySQL on Slackware”

  1. Swift Says:

    Dear author,

    Although I don’t know your name,I would like to express heartfelt gratitude to you because your blog titled “JDBC and MySQL on Slackware” helped me a lot! I have been searching for the solution for the said problem! I wasted 2 days to search on the google and yahoo. Your blog saved the day.Thanks again!

  2. William Says:

    You’re the man!

    I haven’t used Slack in awhile and just switched from Xubuntu to Slackware 12.2 and had this problem.

    You saved me some time. Thank you.

Leave a Reply