Visit Jeremy's Blog.
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 07-28-2009, 02:09 PM   #1
Registered: Aug 2007
Location: Bangalore
Distribution: fedora
Posts: 112

Rep: Reputation: 15
mysql: cannot create database

I tried creating a database in mysql but couldn't do is the message i got from the shell:

deostroll@deostroll-pc:~$ mysql -u mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 43
Server version: 5.0.67-0ubuntu6 (Ubuntu)

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

mysql> create database help
    -> ;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'help'
mysql> quit
Old 07-28-2009, 02:14 PM   #2
LQ Guru
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295

As the message states:
 Access denied for user ''@'localhost'
This user has no rights to create anything. Login as the MySQL root (NOT your root account at linux level!)
mysql -u root -p
It will ask you for a password. This is the password you choose when installing MySQL.

Kind regards,

Old 07-29-2009, 02:11 PM   #3
Registered: Aug 2007
Location: Bangalore
Distribution: fedora
Posts: 112

Original Poster
Rep: Reputation: 15
Still not working...

I did the installation a long time ago. I did somehow change the mysql's root login to "mysql". I do remember changing some config file. I am quite sure that I did not put a password for whatever login name I had assigned. Now I don't even remember where the config file is...!

I found the web page from where I learned to install mysql server. There is a section in my.cnf that goes like:
# * Basic Settings

#   If you make changes to these settings and your system uses apparmor, you may
#   also need to also adjust /etc/apparmor.d/usr.sbin.mysqld.

user		= mysql
pid-file	= /var/run/mysqld/
socket		= /var/run/mysqld/mysqld.sock
port		= 3306
basedir		= /usr
datadir		= /var/lib/mysql
tmpdir		= /tmp
language	= /usr/share/mysql/english
Yeah I think I messed up there (see the underlined part)...I don't know what I did here or why i did it...?

Last edited by deostroll; 07-29-2009 at 02:29 PM.
Old 07-29-2009, 02:26 PM   #4
Senior Member
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,274

Rep: Reputation: 148Reputation: 148
just type mysql and check whether can login to the mysql
Old 08-04-2009, 01:17 PM   #5
Registered: Aug 2007
Location: Bangalore
Distribution: fedora
Posts: 112

Original Poster
Rep: Reputation: 15
yes I am able to get to the mysql prompt...however I cannot create any database there...


create, database, mysql, ubuntu

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
Create / Lookup MySQL Users for Database carlosinfl Linux - Server 2 04-22-2009 02:54 PM
mySQL - archive & create new database via cron? hattori.hanzo Linux - Software 4 04-21-2008 07:13 AM
Create mysql user for backup of database timgerr Linux - Server 2 01-04-2008 10:44 AM
How to create Database in mysql irfanhab Linux - General 1 12-16-2004 06:37 PM
query DNS and create mysql database nabil Programming 0 01-18-2002 04:42 AM > Forums > Linux Forums > Linux - Server

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

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