effortsing
mysql> create database ceshi;
Query OK, 1 row affected (0.01 sec)

给数据库授权,否则程序时无法连接ceshi数据库的,每次创建一个数据库都要记得给数据库授权。

mysql> grant all privileges on ceshi.* TO \'root\'@\'%\' identified by \'jenkins@123\' with grant option;
Query OK, 0 rows affected, 1 warning (0.01 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> use ceshi;
Database changed

mysql> create table if not exists test ( id int(10) PRIMARY KEY AUTO_INCREMENT, name varchar(50) NOT NULL);
Query OK, 0 rows affected (0.04 sec)

mysql> insert into test values(1,\'dahuju\');
Query OK, 1 row affected (0.00 sec)

mysql> insert into test values(2,\'yunjisuan\');
Query OK, 1 row affected (0.00 sec)

mysql> select * from test;
+----+-----------+
| id | name |
+----+-----------+
| 1 | yunjisuan |
| 2 | dashuju |
+----+-----------+
2 rows in set (0.00 sec)

 

分类:

技术点:

相关文章:

  • 2022-01-30
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2021-12-25
  • 2021-12-19
  • 2021-12-07
猜你喜欢
  • 2022-12-23
  • 2021-11-30
  • 2021-04-27
  • 2023-03-23
  • 2021-10-29
相关资源
相似解决方案