I suspect the related link won't help. The MySQL server isn't one
under J.S.'s ownership control (as I understand it) but is a shared
hosting provider.
I saw this one, but it seems to use a lot of the command line, and I
didn't know how all that translates into a Python script. My goal was to
do it all using just mysqldb, but maybe it's just easier (or more
normal) to create a database in another way, and *then* use mysqldb to
manipulate it.
From the linked article:
m> First off all we connect to the MySQL server in the way described in
the last section:
m>
m> > mysql -u root -p
m>
m> The user will be prompted for the password:
m>
m> Enter password: *****
Those lines invoke the simple command-line command processor for
MySQL. They are the equivalent of:
con = MySQLdb.connect(user="root", passwd="*****", host="localhost")
#note, no "db="
crs = con.cursor()
m> mysql> use mysql;
m>
crs.execute("use mysql")
#or use 'db="mysql"' on the connect call
Anything the site shows with a "mysql> " prompt is a string that can
be fed to .execute(). If the command returns data (other than the # rows
affected) you need a .fetch???() call to retrieve the data.
The main problem is that the site assumes you are the
"superuser/root/DBA" for the server. IOWs, you are the person who can
create accounts for other people, startup/shutdown the server, and do
/anything/ to /any/ database the server controls.
As a client on a shared host, I suspect the provider created a user
account and A (one) database for that account. The privilege tables for
that user account would have been set so that only that database is
available. The account would have full privileges within that database,
and no privileges to access any other database (including the mysql
master tables). Depending the strictness of the provider, the account
may or may not allow for connections from outside hosts, or only from
"localhost" (ie, CGI applications that are running on the provider's
machine, and not via "mysql -u user -h somewhere.out.there -p" or
programmatic equivalents)
--
Wulfraed Dennis Lee Bieber KD6MOG
(e-mail address removed) (e-mail address removed)
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: (e-mail address removed))
HTTP://www.bestiaria.com/