RESET MySQL root password
mysqld_safe --skip-grant-tables -u root &
UPDATE mysql.user SET Password=PASSWORD('new password') WHERE User='root';
sharing some tech problems and soln
mysqld_safe --skip-grant-tables -u root &
UPDATE mysql.user SET Password=PASSWORD('new password') WHERE User='root';
Posted by Sajjad at 4:32 pm 0 comments
Take a backup of the table which your looking to restore using mysqldump.
mysqldump -u<username> -p<password> <databasename> <tablename> > <path and name of the file>
ex:mysqldump -usridhar -pthajes testdb usermas > /home/sridhar/mysqldump/tablebackup.txt
where we get only usermas table backup.
for restoring to another db. use
mysql <dbname> < /home/sridhar/mysqldump/tablebackup.txt
ex: mysql restDB < /home/sridhar/mysqldump/tablebackup.txt .
Note: If restDB has already usermas table, pls drop before restoring.
Posted by Sajjad at 4:06 pm 0 comments
self.windowTREE.signal_autoconnect (self)
Posted by Sajjad at 11:28 am 0 comments
#!/usr/bin/python
# import MySQL module
import MySQLdb
# connect
db = MySQLdb.connect(host="localhost", user="joe", passwd="secret",
db="db56a")
# create a cursor
cursor = db.cursor()
# execute SQL statement
cursor.execute("SELECT * FROM animals")
# get the number of rows in the resultset
numrows = int(cursor.rowcount)
# get and display one row at a time
for x in range(0,numrows):
row = cursor.fetchone()
print row[0], "-->", row[1]
-
Posted by Sajjad at 12:26 pm 0 comments