準備 MySQL 資料庫
mysql> use test;
mysql> show tables;
mysql> create table mysql_data(id int primary key, name varchar(50));
mysql> show tables;
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| mysql_data |
+----------------+
1 row in set (0.01 sec)
mysql> insert into mysql_data values (1, 'Hello');
mysql> insert into mysql_data values (2, 'World');
mysql> select * from mysql_data;
+----+-------+
| id | name |
+----+-------+
| 1 | Hello |
| 2 | World |
+----+-------+
2 rows in set (0.01 sec)
mysql> GRANT SELECT,INSERT,UPDATE ON 資料庫名.* TO user@host IDENTIFIED BY '密碼';