473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

ERROR 1044: Access denied : How i ruin this error?

I got an error... when i wants to create database "usersinfo"
Username is 'blacksmoke'...

Commandline argumments are:

mysql> select user();
[Is shows correct] : e.g., blacksmoke@localhost

-------

mysql> create database usersinfo;
ERROR 1044: Access denied for user: '@localhost' to database 'usersinfo'

-------

mysql> show databases;
++++++++++++++++++++
+ Databases +
++++++++++++++++++++
+ test +
++++++++++++++++++++
[its ok]..

-------

mysql> use test;
Database changed
[its also ok]..

-------------------------------

but where is error... really i am serious confused... please help Me...
Ooooh! i am tired... help me...

+++++++++++++++++++++++++++++++++++
+ Voice for Help of +
+++++++++++++++++++++++++++++++++++
+ Muhammad Juanid Ahmed Atari +
+++++++++++++++++++++++++++++++++++
Jul 29 '06 #1
9 106160
ronverdonk
4,258 Expert 4TB
Well, you obviously do not have the privilege of creating a data base.
Next quote from the MySql manual (www.mysql.com).
Note: If you get an error such as ERROR 1044 (42000): Access denied for user 'monty'@'localhost' to database 'xxxx' when attempting to create a database, this means that your user account does not have the necessary privileges to do so. Discuss this with the administrator or see Section 5.7, “The MySQL Access Privilege System”.
Ronald :cool:
Jul 30 '06 #2
vssp
268 100+
grant all on (database_name).* to (user)@(hostname) identified by '(password)';

this is the command you need. The parenetheses are not needed, I use them to indicate where you have to put in your specific values. If you are just running one machine you can use localhost for you hostname.

If you need further info on the GRANT command. RTFM.
Aug 26 '06 #3
bclark
2
I am at the same place the guy above was.

I installed mysql into my home directory ( /home/bclark/opt ).

Logged in as the unix user bclark, I issued the command:

mysql_install_db --user=bclark

Then

mysqld_safe --port=10100 --user=bclark &

Then

mysql --user=bclark -p

I never set a password for the superuser bclark, so I just press enter when it prompts me for a password. This is a workstation with only one user ( me ) and I run a firewall, so nobody will be connecting to port 10100. This database is for my personal use, and nothing critical will be stored on it anyway.

Then I do:

mysql> select user();
+------------------+
| user() |
+------------------+
| bclark@localhost |
+------------------+

This is good. ( new to mysql as I am, I expect to have superuser database privileges. However, I do:

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

So I read this thread and do:

mysql> select current_user();

+----------------+
| current_user() |
+----------------+
| @localhost |
+----------------+
1 row in set (0.00 sec)


Hmm, this thread recommends that I need to grant permissions to a user.

I decide to look at the mysql.user table as suggested.

mysql> select * from mysql.user
-> ;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'


Hmm, can't do that.

I would issue the grant command, but I don't know how to log into mysql as the superuser.

How do you do that?

I don't mind wiping out my mysql installation and starting over, but I would rather not create a mysql user or do anything as root ( though I have root access to the box ) I want this to be a local installation of mysql in my home directory for my personal use that does not interfere with the rest of my system.
Jul 24 '07 #4
bclark
2
Ok, I figured it out.

It was step 9 of the mysql version 4.1.22 installation instructions that confused me.

It reads:


9. If you have not installed MySQL before, you must create the MySQL
grant tables:

shell> bin/mysql_install_db --user=mysql

If you run the command as `root', you should use the `--user'
option as shown. The value of the option should be the name of the
login account that you created in the first step to use for
running the server. If you run the command while logged in as that
user, you can omit the `--user' option.


I thought this meant that the mysql superuser would be created to be bclark. I didn't understand that the mysql superuser is root regardless of what you do here.

So I do:

mysql -u root

And I see:

----------------+
| current_user() |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.00 sec)

I do:
mysql> select user, password, host from mysql.user;

+------+----------+------------+
| user | password | host |
+------+----------+------------+
| root | | localhost |
| root | | redacted |
| | | redacted |
| | | localhost |
+------+----------+------------+

Now my CREATE DATABASE command works fine.

I hope answering my own question here will save other mysql newbies who may have been confused in the same way I was some time.
Jul 24 '07 #5
Ok, I figured it out.

It was step 9 of the mysql version 4.1.22 installation instructions that confused me.

It reads:


9. If you have not installed MySQL before, you must create the MySQL
grant tables:

shell> bin/mysql_install_db --user=mysql

If you run the command as `root', you should use the `--user'
option as shown. The value of the option should be the name of the
login account that you created in the first step to use for
running the server. If you run the command while logged in as that
user, you can omit the `--user' option.


I thought this meant that the mysql superuser would be created to be bclark. I didn't understand that the mysql superuser is root regardless of what you do here.

So I do:

mysql -u root

And I see:

----------------+
| current_user() |
+----------------+
| root@localhost |
+----------------+
1 row in set (0.00 sec)

I do:
mysql> select user, password, host from mysql.user;

+------+----------+------------+
| user | password | host |
+------+----------+------------+
| root | | localhost |
| root | | redacted |
| | | redacted |
| | | localhost |
+------+----------+------------+

Now my CREATE DATABASE command works fine.

I hope answering my own question here will save other mysql newbies who may have been confused in the same way I was some time.
I can't understand that. What did you write there?
mysql> select user, password, host from mysql.user; ???? command select user or for example- select tupkreten and is it coma after that?
Nov 4 '07 #6
just type the following command & enter a root password 4 mysql server...most prob(ly) this will solve ur problem...it worked 4 me

cmd :

mysql --user=root -p

=======================my sys log ==========================

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

mysql> select current_user();
+----------------+
| current_user() |
+----------------+
| @localhost |
+----------------+
1 row in set (0.07 sec)

arunmanoj@arunmanoj-desktop:~$ mysql --user=root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 30
Server version: 5.0.67-0ubuntu6 (Ubuntu)

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

mysql> create database test;
Query OK, 1 row affected (0.06 sec)


mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
3 rows in set (0.06 sec)

================================================== ========

if u want more info regarding this feel free 2 contact me...
Oct 29 '08 #7
Mala7
2
Thanks arunmanoj .. i was having the same problem but now it is done
Sep 6 '10 #8
jscpp
1
I meet the problem on OpenSUSE 11.4

Look for my story

root# mysql_install_db

auser> mysql -u root
mysql> create database work
mysql> create user workDba
mysql> grant all on work.* to workDba;
mysql> select host, user from user where user='workDba';
-------------------
mysql shows the data in table:
user=workDba
host=%
------------------
mysql> \q
user> mysql -u workDba work
ERROR 1044 (xx) Access denied (to|on) ''@'localhost'
user> mysql -u root
mysql> create user workDba@localhost;
mysql> show grants for workDba;
----------------
you cal see yourself
----------------
mysql> \q
user> mysql -u workDba work
mysql> \q #this is finish of the last sesion
Idea: kill user workDba!
user> mysql -u root
mysql> drop user workDba;
mysql> \q
user> mysql -u workDba work
---------------
Ok. error
---------------
user> mysql -u root
mysql> create user workDba;
mysql> grant all on work.* to workDba;
mysql> \q
user> mysql -u workDba work
mysql> ...
so may be it shall not help in any case but in my case it works fine
I take idea on "http://dev.mysql.com/doc/refman/5.1/en/access-denied.html": "If you cannot figure out why you get Access denied, remove from the user table all entries that have Host values containing wildcards (entries that contain '%' or '_' characters). A very common error is to insert a new entry with Host='%' and User='some_user', thinking that this enables you to specify localhost to connect from the same machine. The reason that this does not work is that the default privileges include an entry with Host='localhost' and User=''. Because that entry has a Host value 'localhost' that is more specific than '%', it is used in preference to the new entry when connecting from localhost! The correct procedure is to insert a second entry with Host='localhost' and User='some_user', or to delete the entry with Host='localhost' and User=''. After deleting the entry, remember to issue a FLUSH PRIVILEGES statement to reload the grant tables. See also Section 5.4.4, “Access Control, Stage 1: Connection Verification”."
Sep 10 '11 #9
thanks a lot arunmanoj bro......
Jul 11 '14 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: John | last post by:
Hello. I am currently working through a book on Dreamweaver and using PHP. I am having a little trouble with setting up the database though. I have php 4.2.3 and MySQL 4.0.20a. I am running...
0
by: Morten Gulbrandsen | last post by:
Hi programmers, Good morning ;-) I think something is wrong, Running windows I believe first I have to set some password, Which creates some user, Then I can grant the required privileges, for...
0
by: Ike_strong | last post by:
Can anyone help me to figure out why each time I try to access my database using: c:\mysql\bin\inmysql -root -p and afterwards:(i.e. after inputting my at the password prompt) Enter...
2
by: Brent | last post by:
Hi, I keep getting this error intermittently. I can compile many times, and run fine, and then one compile/run of it, out of nowhere I get this. If I restart the computer it fixes it, but it seems...
3
by: dstewart | last post by:
Situation: One common MySQL database server on SuSE 9.1 with all updates. Uses 'rinetd'. Has entries for the appropriate IP addresses of all servers. NOTE: If the appropirate entries are NOT in...
1
by: gasernag | last post by:
I just installed MySQL and phpMyAdmin in Yahoo! webhosting but when I try to create a table I get the error message: #1044-Access denied for user ****@localhost to _DBNAME_. I am sure I have a...
1
by: Shun | last post by:
Hello, Please anybody try to execute this code. I am having a "quick.html" with email Id and name etc..., and henext form is the below "gdform.asp". When i try to execute this i am getting...
5
by: rote | last post by:
I'm using ASP.NET 2.0 and i have copied and pasted the code below to my Global.asax file but it desn't trap the error I want to trap the 401 access denied void Application_Error(object sender,...
5
by: zubair1 | last post by:
Hello, I have a program which deletes files from cache for exampe:- Temporary Internet Cache History Cache Cookie Cache and finally TEMP cache
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.