LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 10-10-2012, 06:49 AM   #1
zak100
Member
 
Registered: Jul 2009
Posts: 225

Rep: Reputation: 2
Creating a database using a new user in mysql


Hi,
Kindly guide me how to create a database in newly created user in mysql.
I have tried the following:
Code:
mysql> create user 'guest' @'127.0.0.1' identified by 'sirsyed'
    -> ;
Query OK, 0 rows affected (0.00 sec)

mysql> \q

[guest@HP-UX617U ~]$ mysql -u guest
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.0.67 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create database perltest1;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'perltest1'
mysql> create database perltest9;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'perltest9'
mysql>
Kindly guide me.

Zulfi.
 
Old 10-10-2012, 07:14 AM   #2
Snark1994
Senior Member
 
Registered: Sep 2010
Location: Wales, UK
Distribution: Arch
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
You need to give the appropriate permissions. Read http://dev.mysql.com/doc/refman/5.1/en/grant.html (official, technical and boring) or http://kb.mediatemple.net/questions/...leges+in+MySQL (simpler to understand)

Hope this helps,
 
Old 10-10-2012, 07:23 AM   #3
jsaravana87
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Blog Entries: 5

Rep: Reputation: Disabled
You have to enable permission for user guest

GRANT ALL PRIVILEGES ON *.* TO 'guest'@'localhost' WITH GRANT OPTION;
 
  


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
[SOLVED] mysql error while creating database ramecare Linux - Server 8 07-28-2011 11:05 AM
How do I create a new mysql user and a mysql database at the shell prompt? puppymagic Linux - Newbie 1 08-07-2010 06:33 AM
Creating FTP user from existing database jgentes Linux - General 2 09-02-2008 02:29 PM
creating database in mysql kc3377 Linux - Software 7 05-05-2008 10:18 AM
creating mysql database Robin01 Linux - Newbie 1 10-28-2003 09:29 PM


All times are GMT -5. The time now is 11:38 PM.

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