Coder Social home page Coder Social logo

mysql.server's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mysql.server's Issues

Connection 'Protocol=pipe' Not Supported Error

Seems there's an issue when using the "pipe" Connection Protocol (NOTE: This is on Windows)

NuGet Package Version

  • MySql.Server v1.1.0
  • MySql.Data v8.0.23
Error Message:
   System.PlatformNotSupportedException : The option 'Protocol=pipe' is not currently supported.
  Stack Trace:
     at MySql.Data.MySqlClient.MySqlBaseConnectionStringBuilder.<>c.<.cctor>b__1_0(MySqlBaseConnectionStringBuilder msb, MySqlConnectionStringOption sender, Object value)
   at MySql.Data.MySqlClient.MySqlConnectionStringBuilder.set_Item(String keyword, Object value)
   at System.Data.Common.DbConnectionStringBuilder.set_ConnectionString(String value)
   at MySql.Data.MySqlClient.MySqlConnectionStringBuilder..ctor(String connectionString)
   at MySql.Data.MySqlClient.MySqlConnection.set_ConnectionString(String value)
   at MySql.Data.MySqlClient.MySqlConnection..ctor(String connectionString)
   at MySql.Server.MySqlServer.waitForStartup()
   at MySql.Server.MySqlServer.StartServer()

"Table 'mysql.proc' doesn't exist" when creating stored procedure

Hello,

I tried to create a stored procedure and it gaves me the following error

2017-09-19T03:22:02.0367327Z ##[error]Error Message:
2017-09-19T03:22:02.0367327Z ##[error] Initialization method ControlAcceso.Models.BLL.Tests.DatabaseTests.TestInitialize threw exception. MySql.Data.MySqlClient.MySqlException: MySql.Data.MySqlClient.MySqlException: Table 'mysql.proc' doesn't exist.
2017-09-19T03:22:02.0367327Z ##[error]Stack Trace:
2017-09-19T03:22:02.0367327Z ##[error] at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
2017-09-19T03:22:02.0367327Z ##[error] at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId)
2017-09-19T03:22:02.0367327Z ##[error] at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int64& insertedId)
2017-09-19T03:22:02.0367327Z ##[error] at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
2017-09-19T03:22:02.0367327Z ##[error] at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
2017-09-19T03:22:02.0367327Z ##[error] at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
2017-09-19T03:22:02.0367327Z ##[error] at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
2017-09-19T03:22:02.0367327Z ##[error] at MySql.Data.MySqlClient.MySqlHelper.ExecuteNonQuery(MySqlConnection connection, String commandText, MySqlParameter[] commandParameters)
2017-09-19T03:22:02.0377323Z ##[error] at MySql.Data.MySqlClient.MySqlHelper.ExecuteNonQuery(String connectionString, String commandText, MySqlParameter[] parms)
2017-09-19T03:22:02.0377323Z ##[error] at ControlAcceso.Models.BLL.Tests.DatabaseTests.LevantarInstanciaMySQL() in d:\a\1\s\src\ControlAccesos\ControlAccesos.Tests\Database\DatabaseTests.cs:line 233
2017-09-19T03:22:02.0377323Z ##[error] at ControlAcceso.Models.BLL.Tests.DatabaseTests.TestInitialize() in d:\a\1\s\src\ControlAccesos\ControlAccesos.Tests\Database\DatabaseTests.cs:line 216

This is how I try to create it. The first two scripts are the ones that create the database and insert records in it

` MySqlServer dbServer = MySqlServer.Instance;
dbServer.StartServer();

        //Creo la DB y la selecciono
        MySqlHelper.ExecuteNonQuery(dbServer.GetConnectionString(), string.Format("CREATE DATABASE {0};USE {0};", TestDatabase));

        //Ejecuto los scripts para crear las tablas llenarla de datos
        string directorio = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName;
        MySqlHelper.ExecuteNonQuery(dbServer.GetConnectionString(), File.ReadAllText(directorio + @"\..\ControlAccesos\Models\ControlAccesos.edmx.sql"));
        MySqlHelper.ExecuteNonQuery(dbServer.GetConnectionString(), File.ReadAllText(directorio + @"\..\Scripts DB\Inserts.sql"));
        MySqlHelper.ExecuteNonQuery(dbServer.GetConnectionString(), File.ReadAllText(directorio + @"\..\Scripts DB\SP_ValidarAcceso.sql"));`

Thanks

TestKillProcess test fails After Shutdown()

Expose ProcessId property. After Closing process search by Id and not by name. If more than one instance was running search by name gives appearance that process wasn't killed.

Can you update to a new version of mysqld

Can you update to a new version of mysqld.

The current version is not compatible with some of the servers.

I am looking specifically on mysql server latest 5.6.xx version

Can't get the server to start

I tried to follow the example in a console app.
MySqlServer testServer = MySqlServer.Instance;
//testServer.StartServer();
testServer.StartServer(3206);

Errored out: Server could not be started.

Doesn't work if instance of mysql is running

I have mysql installed and running on port 3306. Because this temporary database uses the default port it is unable to run. Add option to set the port the service will run on.

Connection to 127.0.0.1 stopped working

Connecting to named pipe to address 127.0.0.1 stopped working without a reason. Got code tested with address changed to . (dot) and localhost and works. Gone deeper into MySql.Data lib and not providing IP address is better approach.

Cannot co-exist with existing Mysql server

I'm using MySql.Server to test my DB functionality, and it works really well. Today I installed a real Mysql server on my machine to be able to test my application in a live setting, but suddenly all my tests stopped working.

The first issue is that MySql.Server tries to kill all mysqld processes. This fails for the real server since it (luckily) runs under a different account.

The real problem, though, is that the mysqld process that MySql.Server starts stops right away. I suppose it has to do with conflicting arguments:

http://dev.mysql.com/doc/refman/5.7/en/multiple-servers.html

Maybe it's possible to reconfigure my main server (I'll try that), but it feels as if MySql.Server should adapt to the environment rather than vice versa. Do you agree?

Previous instances not closed properly

If you halt a unit test in the IDE without calling Shutdown, it is impossible to run a new test, since the MySqlServer.StartServer will fail. The reason it fails seems to be the line:
this.ExecuteNonQuery("CREATE DATABASE testserver;USE testserver;", false);
getting an exception saying that the database already exists. (Maybe this is caused by the fix of #1?)

For the moment I'm using the following work-around, but it would be nice if this was built into the MySqlServer.StartServer method:

public static void StartServer()
{
    if (HasStartedTheServer)
        return;
    HasStartedTheServer = true;

    var thisIsWhereWeAre = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location).ToLower();
    foreach (var process in Process.GetProcessesByName("mysqld"))
        try
        {
            var processLocation = Path.GetDirectoryName(process.MainModule.FileName);
            var processParent = Path.GetDirectoryName(processLocation).ToLower();
            if (!thisIsWhereWeAre.StartsWith(processParent))
                continue;
            process.Kill();
            for (var i = 0; i < 10; i++)
                try
                {
                    Thread.Sleep(50);
                    Directory.Delete(processLocation, true);
                    break;
                }
                catch
                {
                }
        }
        catch
        {
        }

    MySqlServer.Instance.StartServer();
}

Cannot start after shutdown

The following code:

var dbServer = MySqlServer.Instance;
Console.WriteLine("Starting");
dbServer.StartServer();
Console.WriteLine("Stopping");
dbServer.ShutDown();
Console.WriteLine("Starting");
dbServer.StartServer();

Gives:

Starting
Stopping
Starting
System.Exception: Could not start server process: The system cannot find the file specified
   at MySql.Server.MySqlServer.StartServer()

StartServer() function throws exception if there is already MySqlServer Instance running

I have MySql installed on my computer, and when i try to run my test , it throws error as below ;

> Server could not be started.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)

This my test code;

public override void CleanUp()
        {
            if (dbServer != null)
            {
                dbServer.ShutDown();
            }
        }
        public override Func<DbConnectionConfiguration> Initialize()
        {
            dbServer = MySqlServer.Instance;
            CleanUp();
            dbServer.StartServer();//Throws exception
            MySqlHelper.ExecuteNonQuery(dbServer.GetConnectionString(), "CREATE DATABASE TestDataBase;");

            return () =>
            {
                return new DbConnectionConfiguration()
                {
                    DataProvider = MySqlProviderInvariantName.ProviderName,
                    ConnectionString = dbServer.GetConnectionString("TestDataBase"),
                };
            };
        }

This test runs well on PCs that mySql have not installed on it. It fails on PC that MySql server installed and running.

My question is , how can i make this test running even when there is MySql Server installed on the PC?

Thanks,

.NET Core Support

Hi

I am currently writing some unit tests where I need to verify some queries against a MySQL database.

Is it possible to upgrade this library to support .NET Core?

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.