ERROR 1044 (42000): Access denied for user

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

ERROR 1044 (42000): Access denied for user

Postby dismas » 21. January 2016 03:12

I tried running XAMPP 5.6.15 but couldn't get the MySQL database to start. So, I uninstalled and went to a previous version, 5.5.30. MySQL Database says it's started now but when I try to create a database, I get the following error:

ERROR 1044 (42000): Access denied for user ''@'localhost' to database

I'm running OS X 10.11.3

So, how can I give myself access? I'm the only user on the Mac in question. I've done various web searches but none of the answers have worked. Thanks.
dismas
 
Posts: 4
Joined: 21. January 2016 03:06
Operating System: OS X 10.11

Re: ERROR 1044 (42000): Access denied for user

Postby Nobbie » 21. January 2016 10:47

How do you "communicate" with MySQL, which tool do you use?
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: ERROR 1044 (42000): Access denied for user

Postby dismas » 21. January 2016 12:42

I'm just using the Terminal window on my Mac.

In order to get to that error though, I went into the /bin directory found within the XAMPP application folder and double clicked on the 'mysql' icon within /bin. It launches a Terminal session that says I'm in MariaDB. That's where I typed "create database foo" and it gave me the above error.
dismas
 
Posts: 4
Joined: 21. January 2016 03:06
Operating System: OS X 10.11

Re: ERROR 1044 (42000): Access denied for user

Postby Nobbie » 21. January 2016 12:49

dismas wrote:I'm just using the Terminal window on my Mac.


So you did not apply any username. You have to apply a valid MySQL User (i.e. "root" without password), otherwise you have no sufficient rights for MySQL.

Do not double click "mysql", instead type it in your terminal with appropriate options. Anyway, why dont you use PhpMyAdmin which comes with Xampp and is preconfigured out of the box?
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: ERROR 1044 (42000): Access denied for user

Postby dismas » 21. January 2016 12:56

I've seen where I should type 'mysql -u root -p' but that just comes back with an error about how mysql isn't a known command.

And I just checked now and in the XAMPP window, the MySQL Database is stopped again. I tried to start it and it won't start... again. That's the reason I went back a version on XAMPP because I read where going back a version would help with that issue. So, I'm back at square one.
dismas
 
Posts: 4
Joined: 21. January 2016 03:06
Operating System: OS X 10.11

Re: ERROR 1044 (42000): Access denied for user

Postby Nobbie » 21. January 2016 18:03

dismas wrote:I've seen where I should type 'mysql -u root -p' but that just comes back with an error about how mysql isn't a known command.


Yes of course, because on OSX programs of the current directory have to be specified, you cannot simply only enter the command name. This is very basic OSX knowledge:

Instead of "mysql" enter "./mysql".

dismas wrote:And I just checked now and in the XAMPP window, the MySQL Database is stopped again. I tried to start it and it won't start... again. That's the reason I went back a version on XAMPP because I read where going back a version would help with that issue. So, I'm back at square one.


No error message? I am not a magician or a clairvoyant, i dont know anything about your PC.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: ERROR 1044 (42000): Access denied for user

Postby dismas » 30. January 2016 19:30

Thank you for your help and I'm sorry my reply was brief the other day. I was trying to get out the door to work.

Anyway, I've fixed my issue. For some reason, I can type "./mysql -u root" without the -p and it logs me in and gives me a MySQL prompt. I've since been able to create databases and run many queries through the terminal.

As for why I haven't been using MyPHPAdmin, I didn't know I could. The book that I had been using wasn't using it to run SQL queries. But I know how now, so I've been using a combo of both.

Thanks again.
dismas
 
Posts: 4
Joined: 21. January 2016 03:06
Operating System: OS X 10.11

Re: ERROR 1044 (42000): Access denied for user

Postby Nobbie » 30. January 2016 20:23

dismas wrote:For some reason, I can type "./mysql -u root" without the -p and it logs me in and gives me a MySQL prompt.


The simple reason is, that Xampp delivers MySQL User "root" without password. That's it!
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 12 guests