具体使用python的DB-API
创建WEB 应用的数据库和表
其中
mysql> grant all on vsearchlogDB.* to 'vsearch' identified by 'vsearchpasswd';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 'vsearchpasswd'' at line 1
报这个错误,是因为我使用的是MySQL8.+
mysql> create user 'vsearch'@'%' identified by 'vsearchpasswd';
Query OK, 0 rows affected (0.03 sec)
mysql> grant all privileges on vsearchlogDB.* to 'vsearch'@'%';
Query OK, 0 rows affected (0.00 sec)
#其中‘%’是host,我用的是本地host所以应该是‘localhost’
应该使用这个命令,就是正确的了