Online Learning Academy - LearnAcad.com

... Sharing Knowledge

  • Increase font size
  • Default font size
  • Decrease font size
Home
MySQL


How to Change/Set the root password of MySQL?

E-mail Print PDF

Syntax:

mysqladmin -u root password “newpassword”

mysqladmin -u root -h host_name password “newpassword”

Example:

mysqladmin -u root password ws8dr8as3

mysqladmin -u root -h localhost password ws8dr8as3

You will also want to restart the database server after running this command

sudo /etc/init.d/mysql restart

 

How to Create a user & database in MySQL?

E-mail Print PDF

Creating User in MySQL:

CREATE USER 'shaukat'@'%' IDENTIFIED BY 'my_Sec_Pass';

GRANT USAGE ON * . * TO 'shaukat'@'%' IDENTIFIED BY 'my_Sec_Pass' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;

Creating Database in MySQL:

CREATE DATABASE IF NOT EXISTS `shaukat` ;

Granting all privileges to created user:

GRANT ALL PRIVILEGES ON `shaukat` . * TO 'shaukat'@'%';

Last Updated on Monday, 07 June 2010 12:28
 


Page 2 of 2
Follow us on Twitter

Main Menu

Linux

Islam

Windows

Interview Questions

Database

Internet

Cisco

Entertainment

Networking

Graduate Courses

Psychology

Feed Burner

Subscribe to Welcome to Online Learning Academy by Email

Enter your email address:

Delivered by FeedBurner


Google Groups
Subscribe to LearnAcad
Email:
Visit this group

Login Form