I'm running out of ideas.

This commit is contained in:
flash 2021-07-30 04:23:00 +02:00
parent 82eeaa93ab
commit b81e048f06

View file

@ -110,12 +110,15 @@ namespace BackupManager {
using (MySqlConnection conn = new MySqlConnection(connStr.ToString())) {
conn.Open();
using (MySqlCommand comm = new MySqlCommand(@"SHOW DATABASES;", conn))
using (MySqlDataReader read = comm.ExecuteReader()) {
while (read.Read()) {
using(MySqlCommand comm = new(@"SET NAMES 'utf8mb4';"))
comm.ExecuteNonQuery();
using(MySqlCommand comm = new MySqlCommand(@"SHOW DATABASES;", conn))
using(MySqlDataReader read = comm.ExecuteReader()) {
while(read.Read()) {
string database = read.GetString(0);
if (string.IsNullOrEmpty(database) || exclude.Contains(database))
if(string.IsNullOrEmpty(database) || exclude.Contains(database))
continue;
databases.Add(database);