LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-07-2010, 12:39 AM   #1
puppymagic
Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 63

Rep: Reputation: 4
Arrow How do I create a new mysql user and a mysql database at the shell prompt?


thanks a lot, experts at Linux Questions!!
 
Old 08-07-2010, 06:33 AM   #2
carltm
Member
 
Registered: Jan 2007
Location: Canton, MI
Distribution: CentOS, SuSE, Red Hat, Debian, etc.
Posts: 703

Rep: Reputation: 97
To create the database:
mysql -p -e "create database MyProject;"

To grant full access to only this database:
mysql -p -e "grant all privileges on MyProject.* to 'MyAdmin'@'localhost' identified by 'PassWord';"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql: cannot create database deostroll Linux - Server 4 08-04-2009 01:17 PM
Create mysql user for backup of database timgerr Linux - Server 2 01-04-2008 10:44 AM
How to create Database in mysql irfanhab Linux - General 1 12-16-2004 06:37 PM
MySQL - command - create user/single database dmedici Linux - Software 3 06-21-2004 03:17 PM
query DNS and create mysql database nabil Programming 0 01-18-2002 04:42 AM


All times are GMT -5. The time now is 04:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration