Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Problem with Mysql database

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

  1. danzokulov

    danzokulov

    Joined:
    Oct 1, 2022
    Posts:
    21
    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:
    21
    Sorry, not "MySqд" in error, it is "MySql"
     
  3. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    738
    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:
    4,019
    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:
    21
    Thanks! It helped
     
  6. danzokulov

    danzokulov

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