Recent

Author Topic: Connection MySQL database  (Read 15257 times)

Kalevi

  • New Member
  • *
  • Posts: 29
Re: Connection MySQL database
« Reply #15 on: November 03, 2017, 12:07:41 pm »
My  MySQL-server  is 5.7

rvk

  • Hero Member
  • *****
  • Posts: 6162
Re: Connection MySQL database
« Reply #16 on: November 03, 2017, 12:13:46 pm »
And can you connect from the mysql console to your database?

(I also already gave you the suggestion to move the database to a shorter simpler path)

Kalevi

  • New Member
  • *
  • Posts: 29
Re: Connection MySQL database
« Reply #17 on: November 03, 2017, 12:20:24 pm »
Its working very well

rvk

  • Hero Member
  • *****
  • Posts: 6162
Re: Connection MySQL database
« Reply #18 on: November 03, 2017, 12:24:43 pm »
Then I don't know why you can't connect from Lazarus.

balazsszekely

  • Guest
Re: Connection MySQL database
« Reply #19 on: November 03, 2017, 04:24:41 pm »
Please do the following:
1. Disable every AV, firewall even the built in defender
2. Download libmysql5.7(64 bit) from here: https://drive.google.com/open?id=0B9Me_c5onmWoQmJ2RUtqYVFaMlU
3. Extract the content of the zip to the Lazarus main folder and your project folder, forget about windows system folders
4. Make sure the mysql server is running
5. Database name instead of "c:\lazarus\Omat..." should be "uusipenni"
6. Double check username and password

I just tested the above method with a local mysql database and it works fine, so it's nothing wrong with the lazarus component.


rvk

  • Hero Member
  • *****
  • Posts: 6162
Re: Connection MySQL database
« Reply #20 on: November 03, 2017, 04:31:24 pm »
5. Database name instead of "c:\lazarus\Omat..." should be "uusipenni"
Yikes. Yes, that's probably the cause  8)

In Firebird you need to specify the path and database filename.
For MySQL you just need to supply the databasename.

Kalevi

  • New Member
  • *
  • Posts: 29
Re: Connection MySQL database
« Reply #21 on: November 03, 2017, 07:30:47 pm »
I first deleted the entire Lazarus program and after that installed it once again. I also delete all the Lazarus projects, and finally I created a new project (please see the attachment). I also tested if I change the database name even one char so I again receive  the same error message. I also tested with several databases that work with Workbench, and again with the same outcome.

rvk

  • Hero Member
  • *****
  • Posts: 6162
Re: Connection MySQL database
« Reply #22 on: November 03, 2017, 07:34:31 pm »
 You forgot to check the checkbox for skipversioncheck.

(And do you really have a databasename with .sql after it? Never seen that)

Kalevi

  • New Member
  • *
  • Posts: 29
Re: Connection MySQL database
« Reply #23 on: November 03, 2017, 08:02:03 pm »
I tested as you suggested.

rvk

  • Hero Member
  • *****
  • Posts: 6162
Re: Connection MySQL database
« Reply #24 on: November 03, 2017, 08:08:16 pm »
I'm not that familiar with the TMySQL56Connection but is port 0 correct? Does it take the default mysql port in that case?

Otherwise set it to 3306.

balazsszekely

  • Guest
Re: Connection MySQL database
« Reply #25 on: November 04, 2017, 08:04:25 am »
It's pretty obvious that something is between you(lazarus) and the server. I can easily simulate your error message, just by changing the host name(https://youtu.be/FHCObKukq8o). Again disable firewall. Port number also can be an issue as @rvk mentioned. If you made a default installation(3306) you can leave it to 0 in lazarus, otherwise change it to whatever port is in your ini file, see attachment.
« Last Edit: November 04, 2017, 08:42:43 am by GetMem »

Deepaak

  • Sr. Member
  • ****
  • Posts: 454
Re: Connection MySQL database
« Reply #26 on: November 04, 2017, 08:22:02 am »
What's ur database path
and
Name of ur Server.
Holiday season is online now. :-)

Kalevi

  • New Member
  • *
  • Posts: 29
Re: Connection MySQL database
« Reply #27 on: November 04, 2017, 10:54:52 am »
Now it works! Excellent!
I changed the port 3306 and created a new schema for MySQL.
Additionally, I made the following changes:
1. I copied libmysql.dll version 3.11.2017 5173kt only to the Lazarus directory (not Windows/system32).
2. I added a checkbox for skipversioncheck.
3. I wrote the databasename without ".sql"

 

TinyPortal © 2005-2018