mysql problem in linux

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
pmchacin
Posts: 6
Joined: Wed Dec 17, 2008 5:14 am

mysql problem in linux

Post by pmchacin » Wed Dec 17, 2008 5:19 am

Hi, I have a problem when trying to connect to a mysql database from Linux. The program works fine in windows but not on Linux.

I write the code in the connect button is this:
on mouseUp
answer "calidad esto si funciona"
global gConID

put revOpenDatabase("mysql", "localhost", "test", "root","" )into tConID
if tConID is "" then
answer warning "Problem creating or accessing database!"
else
answer information "AppReg Connected! Your connection ID is: " & tConID
put tConID into gConID
end if
answer information "ni modo no dijo nada"
answer "el valor de la variable es "&tConID
end mouseUp

What am I doing wrong?

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Wed Dec 17, 2008 6:53 am

Can you post what exactly is shown upon

Code: Select all

answer "el valor de la variable es "&tConID 
as it is a little difficult to know what's wrong when you don't have the error message :-)

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

pmchacin
Posts: 6
Joined: Wed Dec 17, 2008 5:14 am

The problem

Post by pmchacin » Wed Dec 17, 2008 8:21 pm

Janschenkel wrote:Can you post what exactly is shown upon

Code: Select all

answer "el valor de la variable es "&tConID 
as it is a little difficult to know what's wrong when you don't have the error message :-)

Jan Schenkel.
Hey, thanks for responding.
*** I am using a traductor from spanish. ***
The problem is that it does not get any error message, just in linux does not do anything or show any message. All messages (answer) that I place after the command revOpenDatabase are ignored. In Windows runs perfect but not in Linux. any code to show me the error ?


I took the code to connect to the database from dictionary and works properly on Windows. All messages (answer) that I place after the code also are shown. But Linux does nothing, does not show any message after the code to connect to mysql.

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Thu Dec 18, 2008 7:18 am

Could you wrap it within a 'try-catch' structure and see if it throws an error? Also the correct way to see if a connection was established, is checking if the connecton ID is a number - otherwise it should contain an error string beginning with "revdberr"

Code: Select all

on mouseUp 
  answer "calidad esto si funciona" 
  global gConID 

  try
    put revOpenDatabase("mysql", "localhost", "test", "root","" )into tConID 
  catch tError
    answer error "ERROR:" & return & tError
    exit mouseUp
  end try
  if tConID is not an integer then 
    answer warning "Problem creating or accessing database!" & return & tConID
  else 
    answer information "AppReg Connected! Your connection ID is: " & tConID 
    put tConID into gConID 
  end if 
  answer information "ni modo no dijo nada" 
  answer "el valor de la variable es "&tConID 
end mouseUp
HTH,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

pmchacin
Posts: 6
Joined: Wed Dec 17, 2008 5:14 am

Post by pmchacin » Thu Dec 18, 2008 4:13 pm

Janschenkel wrote:Could you wrap it within a 'try-catch' structure and see if it throws an error? Also the correct way to see if a connection was established, is checking if the connecton ID is a number - otherwise it should contain an error string beginning with "revdberr"

Code: Select all

on mouseUp 
  answer "calidad esto si funciona" 
  global gConID 

  try
    put revOpenDatabase("mysql", "localhost", "test", "root","" )into tConID 
  catch tError
    answer error "ERROR:" & return & tError
    exit mouseUp
  end try
  if tConID is not an integer then 
    answer warning "Problem creating or accessing database!" & return & tConID
  else 
    answer information "AppReg Connected! Your connection ID is: " & tConID 
    put tConID into gConID 
  end if 
  answer information "ni modo no dijo nada" 
  answer "el valor de la variable es "&tConID 
end mouseUp
HTH,

Jan Schenkel.


Hi Jan, thank you for your interest in helping me. I used the code that you said try-catch, and now I get an error message. Of course it means to know and therefore I do not know what is failing. Important, I get the same error when mysql is running that when is stopped. Here the error code:
ERROR:
219,6,9, revOpenDatabase
465,6,1

Any help would be appreciated.
Sincerely: Pedro Chacin

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Thu Dec 18, 2008 10:06 pm

It looks like it can't find/load the revdb external. Is this a compiled standalone application or inside the Revolution IDE?
If it is a standalone, did you include the Database support library in your application settings?

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

pmchacin
Posts: 6
Joined: Wed Dec 17, 2008 5:14 am

Post by pmchacin » Fri Dec 19, 2008 1:09 am

Janschenkel wrote:It looks like it can't find/load the revdb external. Is this a compiled standalone application or inside the Revolution IDE?
If it is a standalone, did you include the Database support library in your application settings?

Jan Schenkel.

Jan, you're a genius. Thank you very much, the problem is solved. I was putting Database support correctly with the option mysql but I was not putting the option database in Scrip libraries. I am infinitely grateful, and if I can just help you in something, here my email: (pmchacin@yahoo.com).

Note:Additionally, I had to change the socket mysql in my.cnf file because it looks at the socket in / tmp / mysql.socket and was in another location, then it will be able to connect.

Pedro Chacin
Venezuela

Post Reply