我正在尝试将我的C#应用程序连接到web服务器数据库(Mysql)。我正在使用下面的代码。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
namespace mySqlConnectivity
{
public
嗨,所以我正在创建一个windows应用程序登录页面。它连接到远程MySQL数据库。
因此,经过测试,我意识到我正在运行一个VPN。这是在访问数据库仍然很好的时候。
现在,当我在没有VPN的情况下运行它时,我会得到以下错误:
MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.
at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.Dr
我使用windows,以前在一些遗留项目中安装了mysql 5.5,现在我想使用5.7作为一个新的项目,所以我在另一个目录中安装了5.7,在另一个端口上安装了5.7,并且有不同的数据目录,我的问题是当我从cmd启动mysql时,例如:
W:\MySQL57\bin> mysql -u root -p
其结果是:
W:\MySQL57\bin>mysql -u root -p
Enter password: *****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id
我正在开发一个网页(ASP.NET/ C#),通过SSH在远程服务器上查询(MySQL)数据库。我正在使用这两个库(mysql-连接器-net6.9.7)和(Renci.SshNet.dll)。
我可以通过SSH连接使用远程服务器上的MySQL工作台访问MySQL数据库:
"**portal.RemoteServer.edu:22**" using "**RemoteServerUsername**" and
"**RemoteServerPassword**".
下面是我的C#代码,它不返回远程服务器上的客户端表中的任何数据:
M
因此,我正在尝试将新记录添加到SQL数据库中。MySQL数据库服务器在XAMPP上运行,我已经将用户名配置为root,并将密码配置为要测试的密码。我尝试了'localhost‘和'127.0.0.1’作为服务器地址,但它们都不起作用。这是在使用:
using System;
using System.Data;
using Gtk;
using MySql.Data;
using MySql.Data.MySqlClient;
当单击该按钮时,它会捕获异常并显示一条错误消息,但我不知道连接到服务器失败的原因。
protected void OnAddItemClicked(ob
我想通过SSH通道连接到服务器上的mysql数据库。
我已经下载了这个库。
这就是我已经尝试过的,我认为在我的安全连接建立之后,它会工作。
我的SSH连接已建立,但未执行到数据库的正常连接。
所以请检查我的代码:
using (var client = new SshClient("cpanel****", "******", "******"))
{
client.Connect();
con = new MySqlConnection(GetConnectionString(
我想通过Python连接到上托管的MySQL码头来编辑数据库。我遇到了错误:
2003, "Can't connect to MySQL server on '35.200.250.69' ([Errno 61] Connection refused)"
我也试过通过MySQL连接,也没有工作
码头环境
我的Dockerfile:
FROM mysql:latest
ENV MYSQL_ROOT_PASSWORD password
# Derived from official mysql image (our base image)
FROM my
我在asp.net中的web应用程序中使用了mysql。但是,在浏览器中运行它时,它会向我显示此错误。
System.TimeoutException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed
我意识到了一些奇怪的事情,或者是一些我不明白的事情。在我的日记里,我注意到有人试图向mysql求助。我将T4映射到我的服务器,并且可以看到mysql是打开的。一个Firewalld读物说,这些东西在默认情况下不是打开的,我自己也没有打开。
nmap T4
PORT STATE SERVICE
17/tcp filtered qotd
19/tcp filtered chargen
22/tcp open ssh
25/tcp filtered smtp
70/tcp filtered gopher
80/tcp open ht
我在共享主机中有mysql数据库,在一个%面板中用定义为“远程MySQL”。
我在CMD中输入:
C:\xampp\mysql\bin>mysql -u SiteName_username -p pass_of_mysql -h srv3.linuxisrael.co.il
我按回车
Enter password :
我按回车
按住这里进入是对的?
我的计算机上没有安装MySQL密码
我得到了:
mysql error 2003 (hy000) Can't connect to MySQl server on 'srv3.linuxisrael.co.il'
sudo nmap -p0-65535 127.0.0.1
Starting Nmap 7.40 ( https://nmap.org ) at 2018-02-06 19:03 HKT
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0000050s latency).
Not shown: 65525 closed ports
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
80/tcp open http
110/tcp open pop
我正在使用这个。食谱应该允许您设置mysql root密码。它通过以下方式实现这一点
def init_records_script
# Note: shell-escaping passwords in a SQL file may cause corruption - eg
# mysql will read \& as &, but \% as \%. Just escape bare-minimum \ and '
sql_escaped_password = root_password.gsub('\\
运行docker mysql
docker run --name mysql -e MYSQL_ROOT_PASSWORD=root -d mysql:5.7
mysql docker运行容器
Go代码:
package main
import (
"database/sql"
_ "github.com/go-sql-driver/mysql"
)
func main() {
db, err := sql.Open("mysql", "root:root@tcp(172.17.0.2:3306)/test-db")
if
我已经尝试通过ssh隧道转发端口创建远程MySql连接。sshClient连接正常。ForwardedPort启动正常。当我尝试与MysqlConnection连接时,它抛出System.Net.IO.IOException,并显示消息"The handshake to unexpected format“。
端口是OK的100%肯定,因为其他本地应用程序(例如HeidiSQL)可以连接,如果我用我的应用程序创建此端口。
PrivateKeyFile file = new PrivateKeyFile(rsaFile);
client = new SshClie
10:01:04 PM [mysql] Error: MySQL shutdown unexpectedly.
10:01:04 PM [mysql] This may be due to a blocked port, missing dependencies,
10:01:04 PM [mysql] improper privileges, a crash, or a shutdown by another method.
10:01:04 PM [mysql] Press the Logs button to view error logs and ch