LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   My SQL 1045 error : couldn't create database (https://www.linuxquestions.org/questions/linux-server-73/my-sql-1045-error-couldnt-create-database-608682/)

lin_myworld 12-23-2007 06:26 AM

My SQL 1045 error : couldn't create database
 
my sql server is runnin ok.
i m using suse distro.
and i m logged in as root.

whenever i give mysql command in terminal i prints
Code:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
manni is the other user in my pc.

whenver i type mysql -u manniit prints
Code:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 20 to server version: 5.0.26

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

mysql>

but i m unable to create database through this user
Code:

mysql> create database php;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'php'
mysql>

what could be solution..
thanks

prasanta 12-23-2007 09:18 AM

Quote:

and i m logged in as root.
The error clearly states that you are trying to access mysql with giving the root password. Use the following,

mysql -u root -p

This will prompt for the root password.

Quote:

manni is the other user in my pc.
You are able to access mysql using the above user as the user 'manni' does not have password set for the account. But this user has no privileges to create database.

The solution for the above is to login as root and give database creation privileges to the user.

--
Prasanta


All times are GMT -5. The time now is 01:54 AM.