New topic: 

Cannot connect to local Mysql Database

<http://forums.realsoftware.com/viewtopic.php?t=46258>

         Page 1 of 1
   [ 5 posts ]                 Previous topic | Next topic          Author  
Message        Carharttguy          Post subject: Cannot connect to local Mysql 
DatabasePosted: Sun Dec 16, 2012 5:05 pm                         
Joined: Wed Sep 17, 2008 2:45 pm
Posts: 212                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:



My settings for RealBasic:



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

Thanks in advance.      
_________________
My native language is not English.  
                             Top                timhare          Post subject: 
Re: Cannot connect to local Mysql DatabasePosted: Sun Dec 16, 2012 5:25 pm      
                   
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 11894
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                Carharttguy          Post 
subject: Re: Cannot connect to local Mysql DatabasePosted: Sun Dec 16, 2012 
5:33 pm                         
Joined: Wed Sep 17, 2008 2:45 pm
Posts: 212                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                timhare          Post subject: 
Re: Cannot connect to local Mysql DatabasePosted: Sun Dec 16, 2012 7:46 pm      
                   
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 11894
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                neonash7777          Post 
subject: Re: Cannot connect to local Mysql DatabasePosted: Mon Dec 17, 2012 
11:43 am                         
Joined: Mon Nov 29, 2010 7:01 pm
Posts: 343                I had this same problem, i fixed it by putting 
"127.0.0.1" as the host.   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 5 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to