Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 12-23-2007, 07:26 AM   #1
Registered: Oct 2007
Location: India
Distribution: Ubuntu 8.04
Posts: 93

Rep: Reputation: 15
Unhappy 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
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
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.

but i m unable to create database through this user
mysql> create database php;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'php'
what could be solution..
Old 12-23-2007, 10:18 AM   #2
Registered: Mar 2005
Location: India
Distribution: Debian
Posts: 368

Rep: Reputation: 37
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.

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.



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
(my)sql: drop database doesn't remove database kpachopoulos Programming 3 09-19-2007 02:32 PM
phpmyadmin error #1045, but command line works judebert Linux - Server 6 12-25-2006 04:05 PM
Weird PHP error: Cannot create MySQL database from a function?!!? JockVSJock Programming 5 09-28-2006 09:46 PM
php trying to connect to local sql, error no such database feetyouwell Programming 11 02-08-2005 01:25 PM
How to create a SQL Database in Linux? Phonics3k Programming 4 08-16-2003 04:31 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:03 AM.

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