LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-23-2007, 06:26 AM   #1
lin_myworld
Member
 
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
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
 
Old 12-23-2007, 09:18 AM   #2
prasanta
Member
 
Registered: Mar 2005
Location: India
Distribution: Debian
Posts: 368

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:00 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
Open Source Consulting | Domain Registration