Skip to content

Commit 1b20eb6

Browse files
committed
updated content for mysql
1 parent 75680b4 commit 1b20eb6

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Readme.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,24 @@ fi
3737
- if certbot fails run `sudo certbot --apache --debug-challenges`
3838
- or list all loaded vhosts `apache2ctl -S`
3939

40+
# MySQL settings a new user and new database
41+
42+
- create a new user `mysql -uroot -p`
43+
- list all users `SELECT User, Host FROM mysql.user;`
44+
-
45+
```sql
46+
-- Create the user
47+
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'user_password';
48+
49+
-- Grant all privileges on a specific database
50+
GRANT ALL PRIVILEGES ON database_name.* TO 'newuser'@'localhost';
51+
52+
-- Apply changes
53+
FLUSH PRIVILEGES;
54+
55+
```
56+
- import db `mysql -u username -p database_name < /path/to/your/file.sql`
57+
4058

4159

4260
### Extend the terminal idle time / disable automatic logout

0 commit comments

Comments
 (0)