LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Creating a database using a new user in mysql (https://www.linuxquestions.org/questions/linux-newbie-8/creating-a-database-using-a-new-user-in-mysql-4175431471/)

zak100 10-10-2012 06:49 AM

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.

Snark1994 10-10-2012 07:14 AM

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,

jsaravana87 10-10-2012 07:23 AM

You have to enable permission for user guest

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


All times are GMT -5. The time now is 08:18 PM.