连接到MySQL无法正常工作? [英] Connecting to MySQL not working?

查看:93
本文介绍了连接到MySQL无法正常工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我使用MySQL Workbench创建了一个数据库和表,我正在尝试测试它的连接并且它一直在失败?

I have created a Database and table using MySQL Workbench, I am trying to test its connection currently and it keep failing?

这是我用来测试连接的代码:

This is the code I have used to test the connection:

using System;
using System.Data;
using MySql.Data.MySqlClient;

namespace ConnectionTestingMySQL
{
    class Program
    {
        static void Main(string[] args)
        {
            string conString = "server=localhost;uid=root;pwd=MyPassword;database=veeo";

            using (MySqlConnection con = new MySqlConnection(conString))
            {
                con.Open();
                if (con.State == ConnectionState.Open)
                    Console.WriteLine("Well Done!");
                else
                    Console.WriteLine("FAIL!");
            }
        }
    }
}

我得到的错误信息是:

"'使用方法'mysql_native_password'对用户'root'的主机'localhost'进行身份验证失败,并显示消息:未知数据库'veeo''"

推荐答案

也许,您应该找到一个MySQL论坛,因为这不是C#问题。
Maybe, you should find a MySQL forum, since this is not a C# issue.


这篇关于连接到MySQL无法正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆