<commit_before># Database users

Before we can create a user we'll have to sign in as the root user, this is done via :
```sql
mysql -u root;
```

To create a user in my sql use :
```sql
create user 'username'@'localhost';
```
@localhost ensures that certain users are only allowed to access the database from a certain network or (local)host

To create a user in my sql that can acces the database from another host in the same network use :
```sql
create user 'username'@'%';
```
% specifies that the user comes from a variable path

We can now access a user via : 
```sql
mysql -u username -p -h 10.177.33.192;
```
-p specifies that the user requires a password to be filled in
-h specifies that the user wants to access a database on another host in the same network
10.177.33.192 is the IP address where the database is allocated

Securing users by providing them with a password is done via :
```sql
IDENTIFIED by 'password';
```
Now that we've created a user we'll want to assign some priveleges to each account, this is done by using :
```sql
GRANT SELECT ON yourDatabase.yourTable TO 'username'@'localhost';
```
We assigned the privelege to use the select command on yourDatabase.yourTable to the username user on localhost,
this will also work with any other database or table that you specified

You can now view your grants or priveleges via<commit_msg>Update database-users.md<commit_after># Database users

Before we can create a user we'll have to sign in as the root user, this is done via :
```sql
mysql -u root;
```

To create a user in my sql use :
```sql
create user 'username'@'localhost';
```
@localhost ensures that certain users are only allowed to access the database from a certain network or (local)host

To create a user in my sql that can acces the database from another host in the same network use :
```sql
create user 'username'@'%';
```
% specifies that the user comes from a variable path

We can now access a user via : 
```sql
mysql -u username -p -h 10.177.33.192;
```
-p specifies that the user requires a password to be filled in

-h specifies that the user wants to access a database on another host in the same network

10.177.33.192 is the IP address where the database is allocated

Securing users by providing them with a password is done via :
```sql
IDENTIFIED by 'password';
```
Now that we've created a user we'll want to assign some priveleges to each account, this is done by using :
```sql
GRANT SELECT ON yourDatabase.yourTable TO 'username'@'localhost';
```
We assigned the privelege to use the select command on yourDatabase.yourTable to the username user on localhost,
this will also work with any other database or table that you specified

You can now view your grants or priveleges via
{'fraction_non_alphanumeric': 0.06926722566532993, 'fraction_numerical': 0.014582573824279986, 'mean_word_length': 4.297297297297297, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3790054', 'n_tokens_mistral': 796, 'n_tokens_neox': 727, 'n_words': 446}