Files
mwitnessing/prisma/custom.sql
2024-02-22 04:19:38 +02:00

36 lines
1.0 KiB
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- create cart user with cartpw password and add permissions to cart database. also allow root to connect from any host
CREATE USER 'cart' @'%' IDENTIFIED BY 'cartpw';
GRANT ALL PRIVILEGES ON `cart`.* TO 'cart' @'%';
FLUSH PRIVILEGES;
GRANT CREATE, ALTER, DROP, REFERENCES ON *.* TO 'cart' @'%';
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON *.* TO 'root' @'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
-- fix Access denied for user 'root'@'192.168.48.4' (using password: YES)
--To allow the root user to connect from any host, you need to create a new root user with the host set to '%'. Heres how to do it:
CREATE USER 'root' @'%' IDENTIFIED BY '7isg3FCqP1e9aSFw';
-- Then grant the new user full access to all databases:
GRANT ALL PRIVILEGES ON *.* TO 'root' @'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
-- revoke login from everywhere as ROOT:
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'root' @'%';
FLUSH PRIVILEGES;
--7isg3FCqP1e9aSFw
ALTER USER 'cart' @'%' IDENTIFIED BY 'cartpw2024';
GRANT ALL PRIVILEGES ON `cart`.* TO 'cart' @'%';
FLUSH PRIVILEGES;