Author Topic: Can't connect with - MySQL  (Read 1890 times)

Offline Agent Smith

  • PCLinuxOS Tester
  • Sr. Member
  • *******
  • Posts: 317
    • Brazilian PCLinuxOS Community
Can't connect with - MySQL
« on: August 20, 2012, 10:27:38 AM »
Gentlemen,

I am experiencing a problem regarding MySQL.

I can not connect with it, with MySQL Workbench, nor with LibreOffice Base.
I 've tried several ways, and not one works.
I can only work with MySQL via phpMyAdmin, which is great, but in my classes, our teacher is basing the studies on MySQL Workbench.

I've installed Unix ODBC, Mysql Connector ODBC and the native LibreOffice plugin to connect with MySQL, but, with no success.

Would you have any tip on this subject ?

Thanks a lot in advance,

Best regards,


Offline Agent Smith

  • PCLinuxOS Tester
  • Sr. Member
  • *******
  • Posts: 317
    • Brazilian PCLinuxOS Community
Re: Can't connect with - MySQL
« Reply #1 on: August 21, 2012, 05:16:22 PM »
Up please...

Help... Anyone...

Thanks in advance!

Best regards,


Online muungwana

  • Hero Member
  • *****
  • Posts: 6228
Re: Can't connect with - MySQL
« Reply #2 on: August 21, 2012, 05:23:23 PM »

I dont know anything about databases but general principles should apply.

You are trying to connect to it, so it must be running as some sort of a service.

What address is it listening on? Are you trying to connect to the same address it is listening on? what error msgs are you getting when its not connecting?

Either you are trying to connect to a wrong address or you are not a member of a group it allows connections on.

.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline Agent Smith

  • PCLinuxOS Tester
  • Sr. Member
  • *******
  • Posts: 317
    • Brazilian PCLinuxOS Community
Re: Can't connect with - MySQL
« Reply #3 on: August 21, 2012, 07:16:13 PM »
Dear Muungwana,

Thanks for your rapid response.

Well, the error messages are as follows: In MySql Workbench Your connection attempt failed for user 'root' from your host to server at 127.0.0.1:3306:
  Database driver: Failed to open library 'mysqlcppconn'. Check settings.


In LibreOffice Base: Status SQL: IM002

[unixODBC][Driver Manager]Data source name not found, and no default driver specified


In LibreOffice Base, using internal MySql connector(Oracle): Status SQL: HY000
Código de erro: 2003

Can't connect to MySQL server on 'localhost' (111)


The server is running in the same machine of the clients.

I can only access my databases through  phpMyAdmin...

What can I possibly do to fix this ?

Tyvm

Regards,


Online muungwana

  • Hero Member
  • *****
  • Posts: 6228
Re: Can't connect with - MySQL
« Reply #4 on: August 21, 2012, 07:29:13 PM »
what does this command give you?

netstat -lptxu

login as root and then run this command and give its output

locate mysqlcppconn
« Last Edit: August 21, 2012, 07:33:21 PM by muungwana »
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8583
  • Aurum nostrum non est aurum vulgi.
Re: Can't connect with - MySQL
« Reply #5 on: August 21, 2012, 08:42:40 PM »
There's obviously something wrong. On a fresh install of MySQL Workbench, I also get the same error. Although libmysqlcppconn6 seemed installed at /usr/lib/libmysqlcppconn.so.6, it is not discovered so it might be a problem in a setting/configuration.

In the meantime, here are search results I am going through but have not quite found something useful.
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Online muungwana

  • Hero Member
  • *****
  • Posts: 6228
Re: Can't connect with - MySQL
« Reply #6 on: August 21, 2012, 09:30:07 PM »
Quote
[root@mtz ink]# find /usr/lib -iname *mysqlcppconn*
/usr/lib/libmysqlcppconn.so.6.1.1.1
/usr/lib/libmysqlcppconn.so.6

maybe its looking for "/usr/lib/libmysqlcppconn.so"?

i cant seem to be able to start this "mysql-workbench" program so i can not test it locally. You can run it under "strace" to know what path it uses to look for the library.

Quote
[root@mtz ink]# cat /usr/bin/mysql-workbench
#!/bin/bash
export LD_LIBRARY_PATH="/usr/lib/mysql-workbench:$LD_LIBRARY_PATH"
export MWB_DATA_DIR="/usr/share/mysql-workbench"
export MWB_LIBRARY_DIR="/usr/share/mysql-workbench/libraries"
export MWB_MODULE_DIR="/usr/lib/mysql-workbench/modules"
export MWB_PLUGIN_DIR="/usr/lib/mysql-workbench/plugins"
export DBC_DRIVER_PATH="/usr/lib/mysql-workbench"
/usr/bin/mysql-workbench-bin $*
[root@mtz ink]#
The problem could be in the above output,"libmysqlcppconn.so.6" library is at "/usr/lib" while the script that starts the executables has path that start with "/usr/lib/mysql-workbench/".

A soft link for the library it is looking for from "/usr/lib" to somewhere in "/usr/lib/mysql-workbench" could solve the problem.
« Last Edit: August 21, 2012, 09:39:05 PM by muungwana »
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline YouCanToo

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 5333
  • Location: Lebanon, OR., USA
    • Spreading the word.......
Re: Can't connect with - MySQL
« Reply #7 on: August 21, 2012, 09:36:18 PM »
I don't even show it as being installed to begin with




UPDATE:   I just installed mysql-workbench and it appears to be working fine for me.



It wanted to add some dependencies during the install, of course I said yes.
« Last Edit: August 21, 2012, 09:43:27 PM by YouCanToo »




Be sure to visit the NEW Knowledge Base


Linux is user-friendly- it's just picky who its friends are!

Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8583
  • Aurum nostrum non est aurum vulgi.
Re: Can't connect with - MySQL
« Reply #8 on: August 21, 2012, 10:37:44 PM »
YCT, the app can be launched but creating a new connection either as root or as a mysql user gives the error.

muungwana, there's is another file /usr/lib/libmysqlcppconn.so.1.1.1.1 that is the shared object linked to /usr/lib/libmysqlcppconn.so.6. I think the problem is Workbench does not know where to look for the lib. It is probably looking for it at /usr/lib/mysql-workbench which is obviously is not there.

I haven't tried a fix yet but it could be as simple as symlinking /usr/lib/mysqlcppconn.co.6 to /usr/lib/mysql-workbench/ ...

As the pharaoh always say, Later on. ;)
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Offline MBantz

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1317
Re: Can't connect with - MySQL
« Reply #9 on: August 22, 2012, 08:03:37 AM »
Just a quick tip,

if running MySql on PCLinuxOS, then accessing MySql via the network is disabled by default in /etc/my.cnf

If this is the case just remark the line about skip-networking

cheers,
MBantz
« Last Edit: August 23, 2012, 12:58:35 AM by MBantz »

Offline Agent Smith

  • PCLinuxOS Tester
  • Sr. Member
  • *******
  • Posts: 317
    • Brazilian PCLinuxOS Community
Re: Can't connect with - MySQL
« Reply #10 on: August 22, 2012, 01:29:15 PM »
Dear Mr. Bantz,

A very cool tip, but I keep getting this error: Cannot Connect to Database Server
Your connection attempt failed for user 'root' from your host to server at localhost:NULL:
  Database driver: Failed to open library 'mysqlcppconn'. Check settings.


Our MySql Workbench is outdated, and I already downloaded the latest source to update it.
But, I guess the problem is somewhere else. That mysqlcppconn is also outdated, and my hunch is it is the trouble maker here.
Would anyone have a tip on where I could download the latest mysqlcppconn and try to update the lib ?

Best regards and thanks for all your opinions.

Edit: After making the changes suggested by Mr. Bantz, LibreOffice Base was able to connect with MySql, but only trough the Oracle plugin.
So, my suspicion on mysqlcppconn is increasing.
« Last Edit: August 22, 2012, 02:00:55 PM by Agent Smith »

Offline MBantz

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1317
Re: Can't connect with - MySQL
« Reply #11 on: August 23, 2012, 12:55:16 AM »
Have you tried to connect to the dabase with the real ip number the server has (instead of using localhost (and the :null part seems odd))?

Also, great tips are given here: http://dev.mysql.com/doc/refman/5.5/en/access-denied.html
« Last Edit: August 23, 2012, 01:03:21 AM by MBantz »

Offline Agent Smith

  • PCLinuxOS Tester
  • Sr. Member
  • *******
  • Posts: 317
    • Brazilian PCLinuxOS Community
Re: Can't connect with - MySQL
« Reply #12 on: August 23, 2012, 01:05:58 PM »
I've tried with localhost, 127.0.0.1, with the same effect.
I am betting my chips on mysqlcppconn, and right now, I am searching for something about it.

Regards,


Online muungwana

  • Hero Member
  • *****
  • Posts: 6228
Re: Can't connect with - MySQL
« Reply #13 on: August 23, 2012, 01:27:16 PM »
I've tried with localhost, 127.0.0.1, with the same effect.
I am betting my chips on mysqlcppconn, and right now, I am searching for something about it.

Regards,

Information about it is already on this thread,nobody has just followed it up yet.

open "/usr/bin/mysql-workbench" script file and modify the two lines that deals with "MODULE_DIR" and "PLUGIN_DIR" with two below lines and try again.

export MWB_MODULE_DIR="/usr/lib:/usr/lib/mysql-workbench/modules"
export MWB_PLUGIN_DIR="/usr/lib:/usr/lib/mysql-workbench/plugins"
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline Agent Smith

  • PCLinuxOS Tester
  • Sr. Member
  • *******
  • Posts: 317
    • Brazilian PCLinuxOS Community
Re: Can't connect with - MySQL
« Reply #14 on: September 21, 2012, 05:41:47 PM »
Hi muungwana,

I altered the script that calls Mysql Workbench with your options, but to no effect, the same error happened.

And,  Mysql Workbench still doesn't work on PCLinuxOS...  :'(

I am working in other solution to this problem, since it seems it will not get off ground.

Sincerely,