Coder Social home page Coder Social logo

Comments (4)

stumpdk avatar stumpdk commented on August 11, 2024

Hi,
When you are using a test running on a system with an existing MySQL server, you have to use another port than the default (3306).
You can start the server using another port like this: MySqlServer.StartServer(int serverPort):

Let me know if it helps you.

from mysql.server.

NazmiAltun avatar NazmiAltun commented on August 11, 2024

Hello,
I've tried it as ;

dbServer.StartServer(3316);

and with some another different ports , but still throws exception. It works when i manually stop MySql service from Service Management.

Edit : I am using MySQL Server 5.7

from mysql.server.

NazmiAltun avatar NazmiAltun commented on August 11, 2024

Sorry, my comment is misleading. When I've changed the port, it doesn't throw exception on StartServer function anymore. I throws error at following line ;

MySqlHelper.ExecuteNonQuery(dbServer.GetConnectionString(), "CREATE DATABASE TestDataBase;");

And this is the exception message :

{"Authentication to host '127.0.0.1' for user '' using method 'mysql_native_password' failed with message: Access denied for user ''@'localhost' (using password: NO)"}

from mysql.server.

NazmiAltun avatar NazmiAltun commented on August 11, 2024

Ok , i've found a solution ;
Problem is connection string that returns from function ;

dbServer.GetConnectionString()

This function returns connection string as ;

Server=127.0.0.1;Port=3316;Protocol=pipe;

I assume when you add "Protocol=pipe" to connection string, it tries to connect to MySql Instance that is already installed rather than the one we create for testing.

When I set connection string manually as ;

...
dbServer = MySqlServer.Instance;
dbServer.StartServer(3316);
MySqlHelper.ExecuteNonQuery("Server=127.0.0.1;Port=3316;", "CREATE DATABASE TestDataBase;");
.....

It worked

from mysql.server.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.