| FAQ/MySQL |
UserPreferences |
| cornerhost wiki | FrontPage | RecentChanges | TitleIndex | WordIndex | SiteNavigation | HelpContents | moin.sf.net |
The Python MySQLdb module is installed. Sample code:
1 2 3 4 5 6 | import MySQLdb
db = MySQLdb.connect(host="db.sabren.com", user="username", passwd="password", db="your_db")
cursor = db.cursor()
cursor.execute("select * from table where id = 3")
row = cursor.fetchone()
print row |
About the only other thing I needed to know was that the the returned items will be in a tuple if there is more than one, not a list. Good to know if you want to do some post processing of the results. - DominicFitzpatrick
More documentation: http://www.devshed.com/Server_Side/Python/PythonMySQL/
Note: This link appears to be dead or otherwise missing - CharlesLaShure
The easiest way to see your database is to log into the web based manager (PHPMyAdmin):
Remember to use your DATABASE username and password, not your normal ftp/mail pair.
The other option to ask for remote access, in which case you could connect from the command line MySQL client from home or a GUI tool like Mascon:
ALTER TABLE tbl_name AUTO_INCREMENT = 1;
mysql -h db.sabren.com -u user -ppassword dbname (dont forget the -h db.sabren.com)
Use mysqldump.
% mysqldump -h old.db.server.com -u old_user -p old_database > data.sql [enter password]
To reimport into a blank database:
% mysql -h db.sabren.com -u user -p database < data.sql [enter password]
Go to http://db.sabren.com and