If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > creating user in mysql through shell script

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-12-03, 08:00
prasanthik83 prasanthik83 is offline
Registered User
 
Join Date: Dec 2003
Posts: 20
creating user in mysql through shell script

Hi !

I am trying to create a user in mysql through shell script. How to create it using shell script.Thanks in advance.

Bye
Prasanthi
Reply With Quote
  #2 (permalink)  
Old 12-16-03, 22:03
mhz mhz is offline
Registered User
 
Join Date: Dec 2003
Posts: 4
#!/bin/bash

mysql --user=root mysql
GRANT ALL PRIVILEGES ON *.* TO $1@localhost;

./script.sh john

will create the mysql user, john without a password and only will accept local connections for that user name. if you'd like it to be more specific, let me know.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On