 |
 |
ERROR 1044: Access denied for user: '@localhost' to database 'mydb'
|
 |
|
 |
|
Mac Elite
Join Date: Mar 2000
Location: Utah, USA
Status:
Offline
|
|
When I try to create a new sql db using:
mysql> create database mydb;
I get this error:
ERROR 1044: Access denied for user: '@localhost' to database 'mydb'
Any ideas?
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Jan 2001
Location: Salt Lake City, UT USA
Status:
Offline
|
|
sounds like your user doesn't have rights to create new DBs. Are you logged as root? Have you granted permissions to the user to create DBs?
What's your setup?
|
|
2008 iMac 3.06 Ghz, 2GB Memory, GeForce 8800, 500GB HD, SuperDrive
8gb iPhone on Tmobile
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Jan 2001
Location: Salt Lake City, UT USA
Status:
Offline
|
|
Oh... I don't know what I'm thinking here. What user are you logged in as? It should be reporting some user, which means you're probably logged in as anonymous, which would have no access.
|
|
2008 iMac 3.06 Ghz, 2GB Memory, GeForce 8800, 500GB HD, SuperDrive
8gb iPhone on Tmobile
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Jan 2001
Location: Salt Lake City, UT USA
Status:
Offline
|
|
Yeah, I'm pretty sure it's anonymous. You need to login as a user:
from the terminal, you can use:
mysql -u username -p
and then it will prompt you for a password. If you don't have any users setup, login as root (which in the default installation doesn't have a password set.) and setup a new user.
as root:
use mysql
insert into mysql (Host,User,Password) values ('host','user',PASSWORD('password'));
Does that make sense? The italics should be your actual values, everything else is verbatim. There are lots of variables, but that will give you a basic user to use.
|
|
2008 iMac 3.06 Ghz, 2GB Memory, GeForce 8800, 500GB HD, SuperDrive
8gb iPhone on Tmobile
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Mar 2000
Location: Utah, USA
Status:
Offline
|
|
Originally Posted by SirCastor
Oh... I don't know what I'm thinking here. What user are you logged in as? It should be reporting some user, which means you're probably logged in as anonymous, which would have no access.
I open terminal then I type "login"
I enter my admin user name and my password.
I then type /usr/local/mysql/bin/mysql
Then I get the mysql prompt.
mysql>
I then type: create database mydb;
Then I get the error.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Mar 2000
Location: Utah, USA
Status:
Offline
|
|
Originally Posted by SirCastor
Yeah, I'm pretty sure it's anonymous. You need to login as a user:
from the terminal, you can use:
mysql -u username -p
and then it will prompt you for a password. If you don't have any users setup, login as root (which in the default installation doesn't have a password set.) and setup a new user.
as root:
use mysql
insert into mysql (Host,User,Password) values ('host','user',PASSWORD('password'));
Does that make sense? The italics should be your actual values, everything else is verbatim. There are lots of variables, but that will give you a basic user to use.
When I enter mysql -u username -p
I get this error:
tcsh: mysql: Command not found.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Mar 2000
Location: Utah, USA
Status:
Offline
|
|
Originally Posted by SirCastor
Yeah, I'm pretty sure it's anonymous. You need to login as a user:
from the terminal, you can use:
mysql -u username -p
and then it will prompt you for a password. If you don't have any users setup, login as root (which in the default installation doesn't have a password set.) and setup a new user.
as root:
use mysql
insert into mysql (Host,User,Password) values ('host','user',PASSWORD('password'));
Does that make sense? The italics should be your actual values, everything else is verbatim. There are lots of variables, but that will give you a basic user to use.
Stupid question, but how do I login as root?
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Jan 2001
Location: Salt Lake City, UT USA
Status:
Offline
|
|
not a stupid question. You don't have a command setup to access MySQL from anywhere, you just need to combine a couple things, or set a command, which is easy.
first, here's how you should login to your mysql
Code:
/usr/local/mysql/bin/mysql -u root -p
that'll prompt you for a password. root probably doesn't have one set yet.
These type on the Command Line should set up a command so you can type 'mysql' without having to go through all those directories to run the client.
It'll also do mysqladmin
Code:
alias mysql /usr/local/mysql/bin/mysql
alias mysqladmin /usr/local/mysql/bin/mysqladmin
|
|
2008 iMac 3.06 Ghz, 2GB Memory, GeForce 8800, 500GB HD, SuperDrive
8gb iPhone on Tmobile
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Mar 2000
Location: Utah, USA
Status:
Offline
|
|
Originally Posted by SirCastor
not a stupid question. You don't have a command setup to access MySQL from anywhere, you just need to combine a couple things, or set a command, which is easy.
first, here's how you should login to your mysql
Code:
/usr/local/mysql/bin/mysql -u root -p
that'll prompt you for a password. root probably doesn't have one set yet.
Sweet! That worked. Thanks! 
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Jan 2001
Location: Salt Lake City, UT USA
Status:
Offline
|
|
Cool
Don't forget to set a password for root, there are actually two of them.
in MySQL, type in this to see the users and if they have anything set.
Code:
use mysql
select User, Host, Password from user;
|
|
2008 iMac 3.06 Ghz, 2GB Memory, GeForce 8800, 500GB HD, SuperDrive
8gb iPhone on Tmobile
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum 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
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|