install mysql-connector in python3 teniendo como default python2

Asked by Oscar E. Monterroso G.

Mi default alias para python es python 2.7.3 en ubuntu os 14.04.3 , Necesito installar el driver de mysql-connector-python en
el directorio de python3 , como lo puedo hacer ?

Gracias por su ayuda.

Oscar E. Monterroso G.
<email address hidden>

Question information

Language:
Spanish Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

see https://launchpad.net/ubuntu/+source/mysql-connector-python/1.1.6-1

there is
python-mysql.connector for python 2.*
and
python3-mysql.connector for python 3.*

Revision history for this message
Oscar E. Monterroso G. (mbsoftwarefinanciero) said :
#2

Hola Manfred,

Te agradezco mucho la ayuda que me brindaste con tu apoyo técnico

para resolver mi problema. Quiero indicarte que con un pequeño

cambio en el mandato desde la shell , si pude instalar el driver para

que corriera en python3 .

shell> sudo python3 setup.py install

Instaló el programa del driver y ya quedó listo para python3 .

Es una gran ayuda de tu parte y te lo agradezco mucho !

Cualquier asunto en que te pueda ayudar estoy a tus ordenes.

Gracias,

Oscar E. Monterroso G.
Ciuda de Guatemala

2015-09-28 2:42 GMT-06:00 Manfred Hampl <
<email address hidden>>:

> Your question #271841 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/271841
>
> Status: Open => Answered
>
> Manfred Hampl proposed the following answer:
> see https://launchpad.net/ubuntu/+source/mysql-connector-python/1.1.6-1
>
> there is
> python-mysql.connector for python 2.*
> and
> python3-mysql.connector for python 3.*
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/ubuntu/+question/271841/+confirm?answer_id=0
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+question/271841
>
> You received this question notification because you asked the question.
>

Revision history for this message
Oscar E. Monterroso G. (mbsoftwarefinanciero) said :
#3

I installed mysql-connector-python

there is a Connection ready.

but when I created an cursor with:

cnx = mysql.connector.connect ( 'local host', .................)

cursor = cnx.cursor()

query = ("SELECT * FROM table xxx ")

cursor.execute(query)

>>>> Result in screen the note : " ¡MySQL connection not available! "

I don't know what happen

Please help me.

Thanks

Oscar Monterroso

Revision history for this message
Manfred Hampl (m-hampl) said :
#4

Can you help with this problem?

Provide an answer of your own, or ask Oscar E. Monterroso G. for more information if necessary.

To post a message you must log in.