Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
limingxinleo committed Jul 14, 2024
1 parent ced9bde commit 662f21e
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,26 @@ $res = di()->get(Importer::class)->import(
file_get_contents(BASE_PATH . '/storage/sql/xxx.sql')
);
```

### 创建用户

```php
<?php

use Fan\SqlImport\Importer;

$config = [
'driver' => 'mysql',
'host' => '127.0.0.1',
'port' => 3306,
'database' => 'test',
'username' => 'root',
'password' => '',
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
];

$res = di()->get(Privilege::class)->createUser('test', '%', '', $config);
$res = di()->get(Privilege::class)->grant('test', '%', '*', '*', $config);
```

0 comments on commit 662f21e

Please sign in to comment.