MySQL: Tworzenie bazy z konsoli

-- tworzenie bazy
DROP DATABASE IF EXISTS mydb;
CREATE DATABASE mydb CHARACTER SET utf8 COLLATE utf8_bin;
CREATE USER 'myuser'@'%' IDENTIFIED BY '****';
CREATE USER 'myuser'@'localhost' IDENTIFIED BY '****';
GRANT ALL ON mydb.* TO 'myuser'@'%' WITH GRANT OPTION;
GRANT ALL ON mydb.* TO 'myuser'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
 
-- dodawanie usera
CREATE USER 'ola'@'%' IDENTIFIED BY 'ola';
GRANT ALL ON *.* TO 'ola'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;

Leave a Reply