Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Cannot connect to MySQL database
icon5.gif  Cannot connect to MySQL database [message #36861] Sat, 14 July 2012 01:28 Go to next message
Small_Dwarf is currently offline  Small_Dwarf
Messages: 8
Registered: July 2011
Promising Member
Hello,

I've installed MySQL Server 5.5 on Windows Vista.
I've removed all compiler and linker errors (especially due to adding libmysql.dll to bin directory of mingw).

But I can't connect to my database called "test".
My code is the following:
MySqlSession session;
if(session.Connect("root",NULL,"test")){
    PromptOK("yes :-)");
} 
else {
    PromptOK("ERROR: Unable to connect to database. :-(");
    SetExitCode(1);
}


(The PromptOKs are there because debugging doesn't work.)
I always see the second (= the error) message.

If I execute "mysql --user=root test" in the correct path (i.e. "C:\Program Files\mysql\MySQL Server 5.5\bin") the mysql monitor shows up and I can execute SQL statements.

Does anybody know what to do?
Thanks in advance!

[Updated on: Sat, 14 July 2012 21:16]

Report message to a moderator

icon3.gif  Re: Cannot connect to MySQL database [message #36866 is a reply to message #36861] Sat, 14 July 2012 22:31 Go to previous message
Small_Dwarf is currently offline  Small_Dwarf
Messages: 8
Registered: July 2011
Promising Member
Yeah! I've solved it. Smile

I edited C:\Program Files\MySQL\MySQL Server 5.5\my.ini with adminstrator privileges and commented out the line
skip-networking
to
#skip-networking
.

Now it works. Very Happy
But I have one question: Could I have known this before? Have I done something stupid during installation of MySQL?

[Updated on: Sat, 14 July 2012 22:32]

Report message to a moderator

Previous Topic: Lowercase field name in table - error
Next Topic: MySQL Example: NativeMySql/NativeMySql.sch: No such file or directory
Goto Forum:
  


Current Time: Sun Jul 21 18:05:49 CEST 2024

Total time taken to generate the page: 0.02942 seconds