Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu Sep 19, 2019 8:07 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Cannot connect to local Mysql Database
PostPosted: Sun Dec 16, 2012 5:05 pm 
Offline

Joined: Wed Sep 17, 2008 2:45 pm
Posts: 220
Hello,

I try to connect to a local database, but I don't know what i'm doing wrong, I presume I have the wrong connection settings.
My connection looks like this on Mysql Workbench:

Image

My settings for RealBasic:

Image

But yeah, I cannot connect, does anyone know what i'm doing wrong?

Thanks in advance.

_________________
My native language is not English.


Top
 Profile  
Reply with quote  
 Post subject: Re: Cannot connect to local Mysql Database
PostPosted: Sun Dec 16, 2012 5:25 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
If you're trying to Add Database to your project, don't. Create the connection in code.

Add a global property to a Module in your project:

db as MySQLCommunityServer

Connect to it in app.Open:

db = New MySQLCommunityServer
db.Host = "localhost"
db.Username = "root"
db.Password = "xxxx"
if not db.Connect then
msgbox "Cannot connect to database."
// do something appropriate
end


Top
 Profile  
Reply with quote  
 Post subject: Re: Cannot connect to local Mysql Database
PostPosted: Sun Dec 16, 2012 5:33 pm 
Offline

Joined: Wed Sep 17, 2008 2:45 pm
Posts: 220
Ok! Understood.

Ist there a reason why adding a database to a project is not a good thing?

Thanks you

_________________
My native language is not English.


Top
 Profile  
Reply with quote  
 Post subject: Re: Cannot connect to local Mysql Database
PostPosted: Sun Dec 16, 2012 7:46 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
It doesn't always work (as you found).
It can crash your project.
It's a very limited editor. There are much better ones out there.
It locks you into a fixed path to your database, which makes it hard to put the app on another computer.
It leads to premature hair loss and cries of exasperation.
Doing it in code makes you one of the cool kids.


Top
 Profile  
Reply with quote  
 Post subject: Re: Cannot connect to local Mysql Database
PostPosted: Mon Dec 17, 2012 11:43 am 
Offline
User avatar

Joined: Mon Nov 29, 2010 7:01 pm
Posts: 446
I had this same problem, i fixed it by putting "127.0.0.1" as the host.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group