

現在、独学でMySQLの勉強をしてます。(pythonをメインで勉強しており、MySQLのテーマを扱ってます）  
MySQLの環境構築を行った後、データベースとテーブル作成というプロセスでエラーが出たため、解消方法をご教授いただきたいです。  
※詳細のステップ3[3つ目]の箇所に記載

■実行したこと  
ステップ1 MySQL serverのインストール  
ステップ2 MySQL Database Driverをpython環境へインストール  
ステップ3 データベースとテーブルの作成(ここで躓いてます)

■詳細（実行したこと）  
ステップ2

[code]

    (base) sugimotoyuuki@sugimotoyuukinoMacBook-Air-2 webapp % sudo -H python3 setup.py install
    Password:
    running install
    running bdist_egg
    running egg_info
    writing vsearch.egg-info/PKG-INFO
    writing dependency_links to vsearch.egg-info/dependency_links.txt
    writing top-level names to vsearch.egg-info/top_level.txt
    reading manifest file 'vsearch.egg-info/SOURCES.txt'
    writing manifest file 'vsearch.egg-info/SOURCES.txt'
    installing library code to build/bdist.macosx-10.9-x86_64/egg
    running install_lib
    running build_py
    creating build/bdist.macosx-10.9-x86_64/egg
    copying build/lib/vsearch.py -> build/bdist.macosx-10.9-x86_64/egg
    byte-compiling build/bdist.macosx-10.9-x86_64/egg/vsearch.py to vsearch.cpython-37.pyc
    creating build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
    copying vsearch.egg-info/PKG-INFO -> build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
    copying vsearch.egg-info/SOURCES.txt -> build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
    copying vsearch.egg-info/dependency_links.txt -> build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
    copying vsearch.egg-info/top_level.txt -> build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
    zip_safe flag not set; analyzing archive contents...
    creating 'dist/vsearch-1.0-py3.7.egg' and adding 'build/bdist.macosx-10.9-x86_64/egg' to it
    removing 'build/bdist.macosx-10.9-x86_64/egg' (and everything under it)
    Processing vsearch-1.0-py3.7.egg
    Removing /Users/sugimotoyuuki/opt/anaconda3/lib/python3.7/site-packages/vsearch-1.0-py3.7.egg
    Copying vsearch-1.0-py3.7.egg to /Users/sugimotoyuuki/opt/anaconda3/lib/python3.7/site-packages
    vsearch 1.0 is already the active version in easy-install.pth
    
    Installed /Users/sugimotoyuuki/opt/anaconda3/lib/python3.7/site-packages/vsearch-1.0-py3.7.egg
    Processing dependencies for vsearch==1.0
    Finished processing dependencies for vsearch==1.0
    
[/code]

ステップ3  
ターミナルで以下を実行  
[1つ目]

[code]

    (base) sugimotoyuuki@sugimotoyuukinoMacBook-Air-2 webapp % mysql -u root -p
    Enter password: 
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 9
    Server version: 8.0.22 MySQL Community Server - GPL
    
    Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
    
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
[/code]

[2つ目]  
※一度作成後、二度目の実行のため、以下のようになってます。

[code]

    mysql> create database vsearchlogDB;
    ERROR 1007 (HY000): Can't create database 'vsearchlogDB'; database exists
    
[/code]

[3つ目]  
_**※ここで躓いてます Query Okのような文言が本来出るとテキスト(Head first python page287に書いてます）**_

[code]

    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
    
[/code]

[![画像の説明をここに入力](https://i.stack.imgur.com/ArOzl.png)](https://i.stack.imgur.com/ArOzl.png)


CC BY-SA 4.0
2021-01-11T12:59:15.610
73218
2021-01-12T02:49:28.737
2021-01-12T02:49:28.737
42784
42784
question
mysql sql
作成したDatabaseに対するGRANT構文でエラーが発生する