Importing a database into MAMP via Terminal, can't connect - mysql

After frivolously attempting to import a large database (84mb) into PHPMyAdmin (tried increasing memory limit, timeout limit), I've tried importing the database via Terminal/command line, only to be denied access to the MySQL database.
I tried the method here: http://nickhardeman.com/308/export-import-large-database-using-mamp-with-terminal/
I tried the root user/password, I tried creating a new user with full db access, still no luck. Getting these errors:
YI:trunk mpfefferle$ /applications/MAMP/library/bin/mysql -u [root] -p [mydbase]
Enter password:
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
bash-3.2# /applications/MAMP/library/bin/mysql -u [admin] -p [mydbase]
Enter password:
ERROR 1045 (28000): Access denied for user '[admin]'#'localhost' (using password: YES)
I'm absolutely at my wit's end. All I wanted to do was check out a working copy of the site from the SVN repos, but I need the mysql db in order to run/edit/test the site so I can update Magento so I can add new features so I can sell some lousy new products. I'm ready to give up on web development entirely. I hate it and I wish the internet would go away forever.

ID-10T Error: I didn't remove the brackets from the command I was trying to execute. /applications/MAMP/library/bin/mysql -u root -p mydbase instead of /applications/MAMP/library/bin/mysql -u [root] -p [mydbase]

Related

Why is MySQL sometimes failing to connect to AWS RDS Aurora

I'm getting a bizarre behavior on an EC2 instance connecting to an AWS RDS cluster that I can't explain. With the exact same connection string, it works about 20% of the time. I at first thought it had to do with a Drupal installation issue, but I stepped back and tried directly connecting from the command line, and I'm getting the same thing. Here are some examples of the outcome:
[root#xxx]# mysql -u admin -h cluster-name-removed.us-east-1.rds.amazonaws.com -p
Enter password:
ERROR 1045 (28000): Access denied for user 'admin'#'10.1.18.15'
[root#xxx]# mysql -u admin -h cluster-name-removed.us-east-1.rds.amazonaws.com -p
Enter password:
ERROR 1045 (28000): Access denied for user 'admin'#'10.1.19.253'
[root#xxx]# mysql -u admin -h cluster-name-removed.us-east-1.rds.amazonaws.com -p
Enter password:
ERROR 1045 (28000): Access denied for user 'admin'#'10.1.18.15'
[root#xxx]# mysql -u admin -h cluster-name-removed.us-east-1.rds.amazonaws.com -p
Enter password:
ERROR 1045 (28000): Access denied for user 'admin'#'10.1.18.15'
[root#xxx]# ^C
[root#xxx]# mysql -u admin -h cluster-name-removed.us-east-1.rds.amazonaws.com -p
Enter password:
SUCCESS.
This also is similar to what I was seeing from Drupal: about a quarter of the time the pages loaded.
Those IP addresses are - I think private IP addresses that I've never seen in our network, so I don't know where they are coming from.
Any suggestions?
This isn't entirely an answer, but I've found two things that work. One might be a red herring.
If I use a connection string that contains the password in it - i.e. -pThePasswordHere - it would complain about a special character in the password, specifically a close parenthesis. When I connect normally, it would tell me Access Denied, but not complain about the parenthesis. Changing the password to not contain special characters made it work.
Creating a new user also made it work.
I didn't test making a new user with the old password with a close parenthesis though so can't say 100% which is the answer.

mysql -v ERROR 1045 (28000): Access denied for user root'#'localhost' (using password: NO)

I need help. When Checking mySQL version I get this error. I do not use mysql a lot and I am trying to set up a Magento store through command line. However, first I am trying to set up mySql from the database. I am using Mac OS Catalina and Zsh terminal.
Error.
mysql -v
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: NO)
I know it must be something with my database but I am confused. Any help would be appreciated. When I try to download Magento 2 setup install I get this similar error.
--db-user=root --admin-firstname=Magento --admin-lastname=User --admin-email=user#example.com --admin-user=admin --admin-password=123123q --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1
SQLSTATE[HY000] [1045] Access denied for user 'root'#'localhost' (using password: NO)
In InstallCommand.php line 264:
Parameter validation failed
EDIT: However, When I connect to mysql -u root I can connect to the database no problem.
You need to pass in the user and password when running mysql from the command line
mysql -u root -p
[enter password]
Alternatively, you can set up a mylogin.cnf (or a .my.cnf) to save the user/password as a file, so you don't need to remember it.
https://dba.stackexchange.com/questions/86595/how-can-i-make-mysql-client-read-password-from-mylogin-cnf

Installed MySQL Server on Mac OSX 10.7.5, receiving a 1045 (28000) error when trying to access MySQL

Relatively new to SQL, I am reaching out for any advice on how to access MySQL via the Terminal shell on a MAC OSX 10.7.5 system. I have gotten this far detailed in the script below, and followed all installation guides on the web, as well as doing a fair amount of troubleshooting to try and move past the "ACCESS DENIED to "KV88#localhost, PASWORD: NO".
Can anyone provide insight on to why I can't input regular MySQL syntax and access the server, I believe I am still stuck in the BASH script environment.
SCRIPT:
ClickAways-MacBook:~ KV88$ sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
Starting MySQL database server
ClickAways-MacBook:~ KV88$ /usr/local/mysql/bin/mysql
ERROR 1045 (28000): Access denied for user 'KV88'#'localhost' (using password: NO)
ClickAways-MacBook:~ KV88$
Thanks in advance
During the installation you had to be asked about root password. So, you can access the server like this:
mysql -u root -p
and input your password. Then give access to your user:
GRANT ALL PRIVLIEGES ON *.* TO 'KV88'#'%' IDENTIFIED BY "<password>";
if you want for a user to be able to do (almost) everything, or create a database under root and give access to this database:
CREATE DATABASE mydb;
GRANT ALL PRIVLIEGES ON mydb.* TO 'KV88'#'%' IDENTIFIED BY '<password>';
Then exit mysql and enter as a user:
mysql -u KV88 -p
or
mysql -u KV88 -p mydb

Unable to log into mysql as root on OpenWRT

I finally decided to post my question as I am encountering high difficulties to connect to the mysql client.
I am using a mySQL database on an OpenWRT OS installed on an Arduino Yun.
I cannot log into mySQL as root, the following error message is displayed:
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using
password: NO)
I tried with suffix -u root (or -uroot) and suffix -p and a supposed password but every time it turns out to be the same error, sometimes with (using password: NO), other times with (using password: YES)
Reading some posts, I tried all the following manipulation :
kill mysqld and then run
mysqld with --skip-grant-tables
It works and I can log into mysql but any operation proposed to UPDATE the password for user root turns a QUERY OK with 0 rows modified. It should be normal I suppose, as I am not log with grant tables I have no access to user informations and privileges.
Note that when I run
SELECT user();
or
SELECT current_user();
I get root# with nothing following.
Re-installing the databases using the script mysql_install_db. It does not work as is saying that no host "Arduino" or "localhost"could be looked up with /usr/bin/resolveip (nota: no such thing in that folder)
using the --force option it works.
I tried what is exposed in the following post SOLVED - MySQL - Can't Log In - Access Denied - Brand New Installation (OpenWRT)
With the command line
mysqladmin -uroot password pwd
I ended with the same answer :
error: 'Access denied for user 'root'#'localhost' (using password:
NO)'
Could anybody help me or tell me what is the cleanest way to uninstall and fully reinstall MySQL on OpenWRT?
Thank you
Well, yeah...
mysqladmin -uroot password pwd
^--missing --
Since you don't specify the password option correctly, you're effectively passing NO password to mysqladmin, and it doesn't log you in.
Try
mysqladmin -u root -p pwd
mysqladmin --user=root --password=pwd
instead.

Cannot log in to mysql using root

So I'm setting up mysql for the first time.
I read somewhere that I have to run this
mysql -u root -p
To log in as root, in order to be able to create tables/databases using the mysql command line.
When I run this, I get prompted for a password - I hit enter (I thought the default password was blank).
I get this error
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: NO)
What's going on?
If you have a fresh installation of MySql you should be able to issue the following command and it should allow your connection.
xyz#ubuntu$ mysql -u root mysql
You then should set the root password and then create a user with the correct level of access.
look HERE for help connecting.