hi, all:

when i try to make a connection to my mysql-server with salchemy, a problem
as follows appears:

>>> from sqlalchemy import *
>>> db=create_engine("mysql://db=drone-005/LN_PABB2,user=pabb,passwd=pabb")
>>> con=db.connect()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File
"/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.4-py2.6-linux-i686.egg/sqlalchemy/engine/base.py",
line 2322, in connect
    return self._connection_cls(self, **kwargs)
  File
"/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.4-py2.6-linux-i686.egg/sqlalchemy/engine/base.py",
line 872, in __init__
    self.__connection = connection or engine.raw_connection()
  File
"/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.4-py2.6-linux-i686.egg/sqlalchemy/engine/base.py",
line 2408, in raw_connection
    return self.pool.unique_connection()
  File
"/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.4-py2.6-linux-i686.egg/sqlalchemy/pool.py",
line 169, in unique_connection
    return _ConnectionFairy(self).checkout()
  File
"/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.4-py2.6-linux-i686.egg/sqlalchemy/pool.py",
line 371, in __init__
    rec = self._connection_record = pool._do_get()
  File
"/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.4-py2.6-linux-i686.egg/sqlalchemy/pool.py",
line 697, in _do_get
    con = self._create_connection()
  File
"/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.4-py2.6-linux-i686.egg/sqlalchemy/pool.py",
line 174, in _create_connection
    return _ConnectionRecord(self)
  File
"/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.4-py2.6-linux-i686.egg/sqlalchemy/pool.py",
line 256, in __init__
    self.connection = self.__connect()
  File
"/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.4-py2.6-linux-i686.egg/sqlalchemy/pool.py",
line 316, in __connect
    connection = self.__pool._creator()
  File
"/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.4-py2.6-linux-i686.egg/sqlalchemy/engine/strategies.py",
line 80, in connect
    return dialect.connect(*cargs, **cparams)
  File
"/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.7.4-py2.6-linux-i686.egg/sqlalchemy/engine/default.py",
line 280, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File
"/usr/local/lib/python2.6/dist-packages/MySQL_python-1.2.3-py2.6-linux-i686.egg/MySQLdb/__init__.py",
line 81, in Connect
    return Connection(*args, **kwargs)
  File
"/usr/local/lib/python2.6/dist-packages/MySQL_python-1.2.3-py2.6-linux-i686.egg/MySQLdb/connections.py",
line 187, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
sqlalchemy.exc.OperationalError: (OperationalError) (2005, "Unknown MySQL
server host 'db=drone-005' (1)") None None

mysql-server is okay, and i can use it successfully in command line as
follows:

$ mysql -h drone-005  -upabb -ppabb LN_PABB2
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8445
Server version: 5.1.41-3ubuntu12.10-log (Ubuntu)

Type 'help;' or '\h' for help. Type '\c' to clear the current input
statement.

mysql>

in short, how to make a connect or engine using hostname, databasename,
user, password ???


Ant response will be welcome!

-- Jia Xiaolei






-- 
NAME: 贾晓磊/Jia Xiaolei
MOBILE: 13011292217
QQ: 281304051
MICRO-BLOG:  http://weibo.com/2183890715
GMAIL: jiaxiaolei19871...@gmail.com <gmail%3ajiaxiaolei19871...@gmail.com>

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to