-- Удаляем старого пользователя
DROP USER IF EXISTS 'scanning_bot'@'localhost';

-- Создаем базу данных
CREATE DATABASE IF NOT EXISTS blockchain_scanner 
CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- Создаем пользователя с mysql_native_password
CREATE USER 'scanning_bot'@'localhost' 
IDENTIFIED WITH mysql_native_password BY 'MySecure#Pass2026!';

-- Предоставляем права
GRANT ALL PRIVILEGES ON blockchain_scanner.* TO 'scanning_bot'@'localhost';
FLUSH PRIVILEGES;

-- Проверка
SELECT user, host, plugin FROM mysql.user WHERE user = 'scanning_bot';

