As per the title say: Is there a way to print standard/native MySQL output on the screen? I'm talking about, e.g. something like this:
san@pcjq:~$ mysql -uroot -p mysql -t -e "SELECT Host,User FROM user;"
Enter password:
+-----------+------------------+
| Host | User |
+-----------+------------------+
| % | slvUser |
| 127.0.0.1 | root |
| localhost | debian-sys-maint |
| localhost | root |
| localhost | sant00 |
+-----------+------------------+
I'm using MySQLdb
and printing fetchall()
doesn't do that at all.
In [11]: cur.execute("SELECT Host,User FROM user")
Out[11]: 5L
In [12]: print cur.fetchall()
(('%', 'slvUser'), ('127.0.0.1', 'root'), ('localhost', 'debian-sys-maint'), ('localhost', 'root'), ('localhost', 'sant00'))
Anyone know a how to do that or if it's possible at all? Cheers!!