 | 
July 29th, 2006, 11:23 PM
| | Banned | | Join Date: Jul 2006 Location: Pakistan Age: 23
Posts: 6
| | 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 +
+++++++++++++++++++++++++++++++++++
| 
July 30th, 2006, 02:32 PM
|  | Moderator | | Join Date: Jul 2006 Location: The Netherlands
Posts: 4,139
| |
Well, you obviously do not have the privilege of creating a data base.
Next quote from the MySql manual (www.mysql.com). Quote: |
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:
| 
August 26th, 2006, 01:01 PM
| | Needs Regular Fix | | Join Date: Jul 2006
Posts: 269
| |
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.
| 
July 24th, 2007, 05:00 PM
| | Newbie | | Join Date: Jul 2007
Posts: 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.
| 
July 24th, 2007, 05:32 PM
| | Newbie | | Join Date: Jul 2007
Posts: 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.
| 
November 4th, 2007, 11:54 PM
| | Newbie | | Join Date: Nov 2007
Posts: 1
| | Quote: |
Originally Posted by bclark 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?
| 
October 29th, 2008, 10:17 AM
| | Newbie | | Join Date: Oct 2008
Posts: 1
| |
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...
|  | | Thread Tools | Search this Thread | | | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | | What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 205,248 network members.
|