Hi there

I use Python3.2 and MySQL(XAMPP's) and pymysql

But I can't connect mysql via sqlalchemy

from sqlalchemy import *

engine = create_engine('mysql+pymysql://teaspoon:teaspoon@localhost/teaspoon')
metadata = MetaData()
t = Table('mytable', metadata,
    Column('mytable_id', Integer, primary_key=True)
)
metadata.create_all(engine)


But, it happens

sqlalchemy.exc.InternalError: (InternalError) (1045, "#28000Access denied for 
user 'teaspoon'@'localhost' (using password: YES)") None None


*teaspoon user has teaspoon password **and teaspoon database exists.*


So, I tried via console to check.

password problem?

c:\xampp\mysql\bin\mysql.exe -u teaspoon -p

-> it is okey! connectable

grant problem? 

mysql> SHOW GRANTS FOR 'teaspoon'@'localhost';
+--------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for teaspoon@localhost                                                 
                                                             |
+--------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'teaspoon'@'localhost' IDENTIFIED BY PASSWORD 
'*C46AB6C0D67A018C7F19102C0E97E4A333976B36' WITH GRANT OPTION |
+--------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

-> it is okey! it have GRANT ALL PRIVILEGES

non-DB problem? 

mysql> use teaspoon
Database changed

-> it is okey! changable teaspoon DB

it cant create TABLE?

mysql> CREATE TABLE teaspoon(id INT(11)
Query OK, 0 rows affected (0.07 sec)

-> creatable TABLE


*Would you tell me why sqlalchemy was deny??*


-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sqlalchemy/-/xwMBG4G18lUJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to