2017-02-16 8 views
0

ここで何が間違っていますか?python mysql-connectorは毎回結果としてNoneを返します。

  1. INFORMATION_SCHEMA

  2. mysqlの

  3. テスト

  4. branchQA

  5. 012:任意のポインタ

    f=mysql.connector.connect(user='root',password='password',host='10.XX.XX.XX.XX',database='branchQA') 
    >>> f 
    <mysql.connector.connection.MySQLConnection object at 0x02CB6A30> 
    >>> c=f.cursor() 
    >>> c 
    <mysql.connector.cursor.MySQLCursor object at 0x02CB6E50> 
    >>> k=c.execute("show databases") 
    >>> k 
    >>> print k 
        File "<stdin>", line 1 
        print k 
         ^
    SyntaxError: Missing parentheses in call to 'print' 
    >>> print(k) 
    None 
    >>> print(k) 
    

    私はそれを示して同じクエリを実行します

答えて

0

実行後のフェッチャルまたはフェッチンはそのトリックを行います。

>>> c.execute 
    >>>k = c.fetchall() 
    >>>k 
関連する問題