-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask_1_web-02.sql
More file actions
24 lines (18 loc) · 786 Bytes
/
Copy pathtask_1_web-02.sql
File metadata and controls
24 lines (18 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
-- Create the holberton_user
CREATE USER holberton_user@localhost IDENTIFIED BY "projectcorrection280hbtn";
-- Grant the necessary permissions
GRANT REPLICATION CLIENT ON *.* TO 'holberton_user'@'localhost';
-- Create the tyrell_corp database and the nexus6 table
CREATE DATABASE tyrell_corp;
USE tyrell_corp;
CREATE TABLE nexus6(id INTEGER, name TEXT);
INSERT INTO nexus6 VALUES (0, "Jarvis");
-- Grant SELECT permissions to holberton_user
GRANT SELECT ON tyrell_corp.nexus6 TO holberton_user@localhost;
-- Create the replica_user
CREATE USER replica_user@'%' IDENTIFIED BY "replica_user";
GRANT REPLICATION SLAVE ON *.* TO 'replica_user'@'%';
-- Grant SELECT permissions on mysql.user to holberton_user
GRANT SELECT ON mysql.user TO holberton_user@localhost;
-- Exit MySQL
exit