Mysql basic operations

To enter into a mysql database

mysql -u root -p

To view the databases-

>show databases;

To view the tables-

>show tables;

To use a specific database

>use <database>;

To drop a database

>drop <database>;

To reset mysql user password including root password

>Update User set Password=md5(‘test’) where Name=oracle;

>SET PASSWORD FOR root@localhost=PASSWORD(‘thyht’),

To view information about a specific user

>select * from users where Name=’root’;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: