
前提
UnityにてC#を使用したMySQL接続をしたいです。
しかし下記の2通りの方法を試しましたが、正常にドライバのインストールができていません。
何故正常にドライバのインストールが出来ていないのでしょうか。
もしくは、他に方法が有ればご教授いただきたいです。
環境
・Windows10
・Unityエディターバージョン: 2021.3.11f1
試したこと①手動でMySql.Data.dllをインストール
①MySql.Data.dll一式をダウンロード
下記サイトの「Select Operating System:」を「.NET & Mono」に変更。
.NET & Mono (Architecture Independent), ZIPをダウンロード。 https://dev.mysql.com/downloads/connector/net/
②PCの.NET Frameworkの確認
下記サイトを参考にv4.8であることを確認
https://learn.microsoft.com/ja-jp/dotnet/framework/migration-guide/versions-and-dependencies?redirectedfrom=MSDN
③MySql.Data.dllをUnityへ貼り付け
①でダウンロードしたファイルの
mysql-connector-net-8.0.31-noinstall\v4.8\MySql.Data.dll を
Unityエディターの Assets/Plugins/に張り付ける
試したこと①にて発生しているエラーメッセージ
Unityエディタ_コンソール
1Assembly 'Assets/Plugins/MySql.Data.dll' will not be loaded due to errors: 2Unable to resolve reference 'Google.Protobuf'. Is the assembly missing or incompatible with the current platform? 3Reference validation can be disabled in the Plugin Inspector. 4Unable to resolve reference 'ZstdNet'. Is the assembly missing or incompatible with the current platform? 5Reference validation can be disabled in the Plugin Inspector. 6Unable to resolve reference 'K4os.Compression.LZ4.Streams'. Is the assembly missing or incompatible with the current platform? 7Reference validation can be disabled in the Plugin Inspector. 8Unable to resolve reference 'BouncyCastle.Crypto'. Is the assembly missing or incompatible with the current platform? 9Reference validation can be disabled in the Plugin Inspector.
試したこと②NuGetForUnityでMySql.Dataをインストール
①githugから最新NuGetForUnity(NugetForUnity.3.0.5.unitypackage)をダウンロード
https://github.com/GlitchEnzo/NuGetForUnity/releases/tag/v3.0.5
②NuGetForUnityをUnityエディターにインポート
①でダウンロードした「NugetForUnity.3.0.5.unitypackage」を実行し、「Import Unity Packate」ポップアップを開く
「Import Unity Packate」ポップアップでインポートボタンをクリックする
③MySql.Dataをインストール
②の作業で作成されたヘッダーメニュー「NuGet」から「Manage NuGet Packages」を選択
「MySQL」で検索し、「MySqlData」をインストール
試したこと②にて発生しているエラーメッセージ
Unityエディタ_コンソール
1Assembly 'Assets/Packages/Google.Protobuf.3.19.4/lib/netstandard2.0/Google.Protobuf.dll' will not be loaded due to errors: 2Unable to resolve reference 'System.Runtime.CompilerServices.Unsafe'. Is the assembly missing or incompatible with the current platform? 3Reference validation can be disabled in the Plugin Inspector. 4 5Assembly 'Assets/Packages/K4os.Compression.LZ4.1.2.6/lib/netstandard2.0/K4os.Compression.LZ4.dll' will not be loaded due to errors: 6Unable to resolve reference 'System.Runtime.CompilerServices.Unsafe'. Is the assembly missing or incompatible with the current platform? 7Reference validation can be disabled in the Plugin Inspector. 8 9Assembly 'Assets/Packages/K4os.Compression.LZ4.Streams.1.2.6/lib/netstandard2.0/K4os.Compression.LZ4.Streams.dll' will not be loaded due to errors: 10Reference has errors 'K4os.Compression.LZ4'. 11 12Assembly 'Assets/Packages/MySql.Data.8.0.31/lib/netstandard2.0/MySql.Data.dll' will not be loaded due to errors: 13Reference has errors 'Google.Protobuf'.


回答1件
あなたの回答
tips
プレビュー