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
»

Enrique Iglesias – Insomniac

Enrique Iglesias – Insomniac ——-[Album ...

article image
»

Visual Basic 2008 Step by Step (with companion CD)

Visual Basic 2008 Step by Step (with companion CD)   Teach ...

article image
»

DeWyze beats Bowersox to win American Idol contest

The winner of the ninth season of American Idol is a choice between ...

article image
»

Microsoft Windows 7 beta

Microsoft Windows 7 beta Windows 7 includes a number of new ...

article image
»

Box.net Adopts HTML5; Adds Drag And Drop Functionality Between The Web And Desktop

Cloud storage and document sharing startup Box.net is the latest ...

alfresco
»

Using the Alfresco archetype to create project

Alfresco Enterprise version 4.1.2 onwards, it fully supports maven ...

8-25-2011subtitleglasses
»

Personal subtitle glasses from Sony may get trial run in UK next year

It’s been quite a while since we’ve heard any news ...

article image
»

All My Movies 5.9

Overview All My Movies is a movie database manager that allows you ...

facebooktranslate2
»

Facebook Now Translates Posts and Comments Not In Your Native Language

Facebook has quietly launched a new feature that lets you translate ...

Get Adobe Flash player