Segmentation fault when Connect to MySQL in python 3.5.1 on AIX 6
Question: I tried to do following tasks: 1 Compile Python 3.5.1 source use GCC 4.2.0 on
AIX 6.0; 2 Use Python 3.5.1 do my work including connect and uses mysql
databae; once I tried this tasks,I can compile python 3.5.1 source
successful,and doing something well except connect and uses database;

    
    
    $/usr/local/bin/python3.5
    Python 3.5.1 (default, Aug 12 2016, 15:48:31) 
    [GCC 4.2.0] on aix6
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import sys
    >>> dir(sys.path)
    ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__iter__', '__le__', '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__rmul__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', 'append', 'clear', 'copy', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']
    

and then I tried install PyMySQL-0.7.6 witch I was working well on Linux and
Windows,and it install successful,but unfortunately,when I tried to use it to
connect to MySQL database,it gave me 'Segmentation fault(coredump)' error and
it abort python automatic;

    
    
    >>> import pymysql
    connection = pymysql.connect(host='150.17.31.113',user='sywu',password='sywu',db='sydb',charset='utf8mb4',cursorclass=pymysql.cursors.DictCursor);>>> connection = pymysql.connect(host='150.17.31.113',user='sywu',password='sywu',db='sydb',charset='utf8mb4',cursorclass=pymysql.cursors.DictCursor);
    Segmentation fault(coredump)
    $
    

again and again,it always like this,I had read core file,it contains unhuman
readable contents,and I can't figure out the problem was, since I can't do it
with pymysql,I tried install mysql-connector-python 2.1.3,it install
successful,but I got 'Illegal instruction(coredump)' error and it abort python
automatic,

    
    
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import mysql.connector
    >>> cnx=mysql.connector.connect(user='sywu',password='sywu',host='150.17.31.113',database='sydb')
    Illegal instruction(coredump)
    $
    

does anyone to do this on aix successful,any help?


Answer: I haven't used AIX but from the code snippet, I could figure that from
<https://github.com/PyMySQL/PyMySQL/blob/master/example.py>, the parameter is
`passwd` not `password`.

    
    
    import pymysql
    
    conn = pymysql.connect(host='localhost', port=3306, user='root', passwd='', db='mysql')
    

Also, in the same library: <https://github.com/PyMySQL/PyMySQL>, look at the
example. May be it can help you out.

