LinuxQuestions.org
Review your favorite Linux distribution.
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 07-28-2009, 02:09 PM   #1
deostroll
Member
 
Registered: Aug 2007
Location: Bangalore
Distribution: fedora
Posts: 112

Rep: Reputation: 15
mysql: cannot create database


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

Code:
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
Bye
deostroll@deostroll-pc:~$
 
Old 07-28-2009, 02:14 PM   #2
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hi,

As the message states:
Code:
 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!)
Code:
mysql -u root -p
It will ask you for a password. This is the password you choose when installing MySQL.

Kind regards,

Eric
 
Old 07-29-2009, 02:11 PM   #3
deostroll
Member
 
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...!

EDIT:
I found the web page from where I learned to install mysql server. http://www.zolved.com/synapse/view_c...ySQL_On_Ubuntu. There is a section in my.cnf that goes like:
Code:
[mysqld]
#
# * Basic Settings
#

#
# * IMPORTANT
#   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/mysqld.pid
socket		= /var/run/mysqld/mysqld.sock
port		= 3306
basedir		= /usr
datadir		= /var/lib/mysql
tmpdir		= /tmp
language	= /usr/share/mysql/english
skip-external-locking
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
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,230

Rep: Reputation: 132Reputation: 132
just type mysql and check whether can login to the mysql
 
Old 08-04-2009, 01:17 PM   #5
deostroll
Member
 
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...
 
  


Reply

Tags
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


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration