MySQL User and Database Creation. Step-by-Step.
# Connect to mysql database as root user.
mysql -h localhost -u root -p
# Create database myfirstdb;
CREATE DATABASE IF NOT EXISTS myfirstdb;
# Create user;
CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypassword';
# Grant Specific Privileges to only myfirsdb
GRANT USAGE ON myfirstdb.* TO 'myfirstuser'@'localhost' IDENTIFIED BY 'mypassword' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
# Grant Specific Privileges to only myfirsdb
No comments:
Post a Comment