Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question Problem with Mysql database

Discussion in 'Scripting' started by danzokulov, Oct 1, 2023.

  1. danzokulov

    danzokulov

    Joined:
    Oct 1, 2022
    Posts:
    22
    Hello! Unity returns an error in my script in lines
    "
    using MySql;
    using MySql.Data;
    using MySql.Data.MySqlClient;
    "
    Error: 12:00:25] Assets\Scripts\DatabaseConnect.cs(5,7): error CS0246: The type or namespace name 'MySqд' could not be found (are you missing a using directive or an assembly reference?)

    Can someone help me please?
     
  2. danzokulov

    danzokulov

    Joined:
    Oct 1, 2022
    Posts:
    22
    Sorry, not "MySqд" in error, it is "MySql"
     
  3. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    2,256
    Did you copy various dlls into your project? Or just try using mysql as a name space?
     
    danzokulov likes this.
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    7,263
    There is no built-in MySql in Unity so you need to follow setup instructions for using MySql library in Unity. As mentioned by bugfinders this involves copying specific DLLs into the project. If you use AssemblyDefinition you also need to reference them in the asmdef.
     
    danzokulov likes this.
  5. danzokulov

    danzokulov

    Joined:
    Oct 1, 2022
    Posts:
    22
    Thanks! It helped
     
  6. danzokulov

    danzokulov

    Joined:
    Oct 1, 2022
    Posts:
    22
    Thanks! It helped