I'm trying to user mysql on my machine, but I can't access the program.
I added configuration using mysql_config_editor as such:
mysql_config_editor set --login-path=client --user=root -p --host=localhost
and when i do a print i get:
[client]
user = root
password = *****
host = localhost
But when I try to connect to mysql, I get the following error
#mysql -u root -p
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using passowd: YES)
And when I try to connect like this, i get:
#mysql -u root -p -h127.0.0.1
ERROR 1130 (HY000): Host 'localhost' is not allowed to this MYSQL server
Every other answer I found was to do a SQL command. But i can't get inside the shell to do it.
Thanks
Have you already tried using the --skip-grant-tables option? If you have, and it doesn't allow you to access the mysql shell, go into your mysql installation folder and open my.ini file (my.cnf for most Linux distros). Inside it you'll find a mysqld tag, add skip-grant-tables underneath it and restart your mysql server. You'll be able to access your shell and therefrom edit the rights/privileges.
Related
I have the correct parameters for mysqldump:
mysqldump -uUSERNAME -p -hREMOTE_HOST_URL REMOTE_DB_NAME > PATH_TO_DUMP_LOCATION.sql
When I execute the command, I always get Got error 1045 stating that the hostname(?) after the # symbol is incorrect. Ex:Correct_Username#Wrong_Hostname.
How do I change it?
"Exact" command and feedback:
: mysqldump -ujosh -p -hresearch.edu datab > C:\S.sql
mysqldump: Got error: 1045: Access denied for user 'josh'#'josh.vpn.es.edu' (using password: YES) when trying to connect
First check REMOTE_HOST_URL with ping and make sure it's same server where MySQL server is installed or use IP of MySQL server.
then check show grants for 'josh'#'josh.vpn.es.edu'; in MySQL server if you have provided access to user josh to connect from josh.vpn.es.edu.
also verify the password.
Since a few hours I'm trying to connect to a local sql environment. It works in one second with MySQL Workbench, but from the commandline MySQL is not very verbose :)
mysql -u root -p root --host=127.0.0.1 --port=10011 -password'root'
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
Somewhere they report to use -u, while somewhere else they suggest --u
How do I find out if mysql is able to reach the server?
What else can I do for troubleshooting?
MySQL command line is a mess, the solution was
mysql -uroot -h127.0.0.1 --port=10011 -proot
Some with -- like port and some with - like p, and with no space.
I have problems connecting to my DB through --defaults-groups-suffix.
~/.my.cnf
[clientdblive]
user=xxx
password=xxx
database=xxx
host=mysql5.example.com
My bash script where I am connecting from:
mysql --defaults-group-suffix=dblive
Returns an error:
ERROR 1045 (28000): Access denied for user 'xxx'#'localhost' (using password: YES)
It somehow seems to ignore the host option in my config file. When connecting directly through the terminal with
mysql -h mysql5.example.com -u xxx xxx -p
it works fine :(
MySQL version: 5.6.19-67.0-log
The problem was a special character (#) in the password. Putting the password in "quotes" fixed it.
I got mysql host, username, password, port, then I use mysql workbench to connect, it's just fine.
But when I use command line:
mysql -h x.x.x.x -u myusername -P myport -pMYPASSWORD MY_DB_NAME
It reported error:
ERROR 1045 (28000): Access denied for user 'myusername'#'mylocal_ip:55489' (using password: Yes)
First of all, the command line connection seems like auto add my local ip address and a random port to my username, can I make a connection without these tails?
Then why mysql workbench can connect success? Does workbench use different command from my command line command?
I installed xampp on 10.9 mavericks. Unfortunately the command mysql does not work in the terminal. I managed to start the mysql monitor from xamppfiles/bin/. When I try to create a new database I get
ERROR 1044 (42000): Access denied for user ''#'localhost' to database XY
What can I do?
No, you should run mysql -u root -p in bash, not at the MySQL command-line. If you are in mysql, you can exit by typing exit.
You may need to set up a root account for your MySQL database:
In the terminal type:
mysqladmin -u root password 'root password goes here'
And then to invoke the MySQL client:
mysql -h localhost -u root -p