MYSQLDUMP: Change thing after # symbol - mysql

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.

Related

Accessing Database with python or command line

I am able to access and query the database on the web interface of PhPMyAdmin using a user credentials. However, when I am trying the following command line commands:
mysql -h (<url of phpmyadmin>) -u (<non-root username>) -p (<database>)
Or this error:
ERROR 2059 (HY000): Plugin http could not be loaded:
dlopen(/opt/homebrew/Cellar/mariadb/10.8.3_1/lib/plugin/http.so,
0x0002): tried:
'/opt/homebrew/Cellar/mariadb/10.8.3_1/lib/plugin/http.so' (no such
file)
I have also tried replacing host with "localhost" and I get this issue:
ERROR 1045 (28000): Access denied for user 'data_analyst'#'localhost'
(using password: YES)
I am not sure how I can connect to get data from the database even though when I connect directly to the webpage I get access to it but when I try the same on command line I am unable to.
With mysql -h it takes a hostname as an argument, not a url. As using localhost as the hostname generates access denied, its making a connection so -h isn't needed as an option (localhost is the default`).
There needs to be a space between -p and the database name. Check the non-root user authentication password.

MySQL connection from command line, how can be a command line utility so unstable?

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.

MySQL Access denied after typing 'mysql -proot'

I am new to MySQL. My issue is, is that after typing mysql -proot in the terminal I am receiving this error:
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
I don't know what i am doing wrong. I did create a password. However I don't really know how to put it in, in combo with this command.
I am using CentOS 6 on my server
It's a typo on the syntax. You need a space between proot. It should be
mysql -p root
instead of
mysql -proot
mysql -proot this command is telling mysql to use root as the password, which I'm assuming is not the password. You need to put a space between the -p switch and the username to be get the interactive password prompt.
mysql -p root

mysql access denied for user ERROR 1045

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.

cannot connect to database from zapier #1044 - Access denied for user

I am trying to connect Zapier to my Database. Zapier has very limited support for this and seem to be going round in circles.
I need to GRANT SELECT to a user on my database with this code;
GRANT SELECT ON my-database-here.my-table-here TO 'user-here'#'ip-address-here' IDENTIFIED BY 'my-password-here';
The error i receive is;
#1044 - Access denied for user 'xxx'#'localhost' to database 'xxxx'
The user has ALL PRIVILEGES but can't seem to get it to work. Any help here could be greatly received.
Thanks
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
you have 2 issues:
1 => mysql -uroot -p should be typed in bash (also known as your terminal) not in MySQL
command-line. You fix this error by typing.
exit
in your MySQL command-line. Now you are back in your bash/terminal command-line.
You have a syntax error:
mysql -uroot -p;
the semicolon in front of -p needs to go. The correct syntax is:
mysql -uroot -p
type the correct syntax in your bash commandline. Enter a password if you have one set up; else just hit the enter button. You should get a response that is similar to this: