Cs0246 Error Help 1

The Unity Console throws this error, but everything is fine in Visual Studio

Assets\database.cs(2,7): error CS0246: The type or namespace name ‘MySql’ could not be found (are you missing a using directive or an assembly reference?)

Thanks in advance


This happens when you try to access a namespace that does not exist, or you do not have the library loaded.

At the beggining of the script, you must add what library or namespaces will you use, like this:

using System;
using System.Collections;
using System.Security.Cryptography;
using System.Text.RegularExpressions;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;

I dont know where mySql derives from, but you need to find and add it.

If using Visual Studio & if you have the library/namespace somewhere inside unity folders, by right-cliking the error in the code, if offers you the option (add"using Unity…something) to solve it.


The appropriate library is added, but unity always throws an error!