Deleted MySql root user accidently? Recreate root account

Deleted MySql root user accidently?

Follow the steps recreate the root user.

  1. If mysql service is already running, stop it.
  2. Open the command prompt and goto MYSQL_HOME/bin directory.
  3. Run following commands


> mysqld --skip-grant-tables

Then start mysql console

> mysql –u=root

Then run following commands

> GRANT CREATE, DROP ON *.* TO root@localhost IDENTIFIED BY 'newpass' WITH GRANT OPTION;

> GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY 'newpass' WITH GRANT OPTION;

Then restart the mysql service and you are done.

Advertisements

OracleXMLQuery: Exception when accessing nested tables

Problem When using OracleXMLQuery to access nested tables, generated XML contains error message

oracle.xml.sql.OracleXMLSQLException: getCollectionMetaData:  this method is not supported by ‘OracleXMLDataSetGenJdbc’ class.  Please use ‘OracleXMLDataSetExtJdbc’ instead.

Description when using OracleXMLQuery to query a view which has a column of user defined type (or Table TYPE column), query executed successfully without any exception.

But when the XML string is obtained using

oxq.getXMLString()

XML String contains above error message.

Driver: Oracle JDBC Driver.

Databse: Oracle 10g

Solution: Looking for solution, if you know the solution, please let me know.

I have found that If I use oracle 9I driver (classes12.zip) instead of classes12.jar or ojdbc14.jar, it works. yes it works but I dont know why !

OracleXMLQuery and xml type columns

Problem: OracleXMLQuery escapes xml if the result set has a column which itself contains xml string.

Description: I have a database view with a varchar2 type column. the column contains xml string. when I use OracleXMLQuery to select data from the view, OracleXMLQuery escapes the xml string.

Solution: I am still looking for the solution, I have tried by changing the column type to XML type, but that also didnt work.