The New Stuff

shell-command-for-bloggers

Create a MySQL Database, Username, Password, and Privileges from the command line


Step 1: Login to MySQL ( you will need an account )

user@server:~$ mysql -u mysql_user -p
Enter password:

Step 2: Create the Database

mysql > create database db_name;

Step 3: Verify that it’s there

mysql > show databases;

Step 4: Create the User

mysql > create user db_user;

Step 5: Grant privileges while assigning the password

mysql > grant all on db_name.* to 'db_user'@'localhost' identified by 'db_password';

*Note: The localhost field usually doesn’t have to be edited, but you can set it to the specific address.

The above example grants all privileges, obviously. But you will likely want to limit privileges under many circumstances. These parameters include select, insert, and delete.
Choose all that apply and separate by comma, thusly:

mysql > grant select, insert, delete on db_name.* to 'db_user'@'localhost' identified by 'db_password';

Comments

comments

Recently Published

article image
»

Magento Admin Menu Not Working After Upgrade

Wondering why your Magento admin menu is not showing up after ...

article image
»

Bachna Ae Haseeno (2008) MP3 songs, soundtrack Download

Bachna Ae Haseeno Music Score: 7/10 Genre: Comedy / Romance Why ...

article image
»

Portable Soft191 Password Manager 1.02

Portable Soft191 Password Manager 1.02 Safely store and easily ...

Apple-TV
»

iTV — The TV You Have Been Waiting For From Apple

An Apple products follower would know that Apple has been working ...

article image
»

Microsoft Office 2010 Now Available Worldwide

Mircrosoft’s much hyped new version of its productivity suite, ...

article image
»

Mark Zuckerberg: Facebook Plans “Something Awesome” Next Week

Have you been invited to Google+? Well, I’ve already been ...

google_i_o-4ea467d-intro-thumb-640xauto-26972
»

Microsoft collects license fees on 50% of Android devices, tells Google to “wake up”

Google’s complaints about patent-based attacks against Android ...

article image
»

Office 2007 Bible

Office 2007 Bible The leading Microsoft Office application experts ...

article image
»

Firefox mobile hits the Nokia N810

Firefox mobile hits the Nokia N810 The much anticipated Firefox ...

Get Adobe Flash player