I have mysql root username and password with me and i am on centos server. I know how to login through putty to the mysql panel.
I am in. we are also connecting the mysql through Navicat and it accepts the SSH connection to the mysql server even we do provide the username / password because the server is not directly linked.
So, what is the possibility that i can change the Password of the SSH which is doing the mysql connectivity through navicat.
how can i use the command console panel to change the SSH to change it
Please do not vote for negative as if the question is not clear, ask me before downvoting
Regards
So, Here is the Solution.
When i was logging into putty, i was doing the ssh using my username and password, the same credentials i used in navicat and bang it worked, so there was no need to change the credentials, i already got it connected to my database, sory about the confusion, hopefully one should never encounter this issue, for me it was hard to debug as i was very new to centos operating system
Related
I am a layman and I am not sure if I understand correctly how does an SSH connection to a MySQL DB work.
Shown below you find a screenshot of a common GUI used to set-up the connection in object.
I understand that I need to insert the MySQL Server IP, the port, my user and password in order to connect to the SQL DB. But I do not fully understand why I need to provide a SSH Server IP address, user and password.
If I am able to connect to a MySQL Server using a direct SSH connection, why would I need to mention an SSH Server (another machine)?
Does the SSH Server act as an intermediary? If so why and how? Could you help me understand?
Thank you in advance.
I'm using a Mac with macOS 10.11.6. I want to connect MySQLWorkbench 6.3.7 to a MySQL database stored on my Linux server. I'm able to create a connection with Sequel Pro but it doesn't work doing the same in MySQLWorkbench. This is what I am doing:
1. Open "Setup New Connection" window
2. Selecting "Standard TCP/IP over SSH"
3. SSH Hostname = my servers IP
4. SSH Username = same I use to login in MySQL database with PHPMyAdmin
5. SSH Password = same I use to login in MySQL database with PHPMyAdmin
6. SSH Key File = I do nothing here, stays empty
7. MySQL Hostname = my servers IP
8. MySQL Server Port = I do nothing here, stays empty
9. Username = same I use to login in MySQL database with PHPMyAdmin
10. Password = this is the password I also use to access my server with the FTP client
11. Default Schema = I do nothing here, stays empty
When clicking "Test Connection", I get:
Please enter password for the following service:
Service: Mysql#MY_IP:3306#MY_IP
User: MY_USERNAME
When I enter the password I get:
Failed to Connect to MySQL at MY_IP:3306 through SSH tunnel at MY_USERNAME#MY_IP with user MY_USERNAME
Can't connect to MySQL server on '127.0.0.1' (61)
What am I doing wrong? Can anybody help me please?
P.S. I replaced the IP and the username with MY_IP and MY_USERNAME.
First, make sure your remote server has ssh enabled on it.
Second, assuming it does have SSH enabled on it, usually the SSH username and the MySQL username will be different (for security reasons). Regardless, make sure you have the correct SSH username / password (and it sounds like you already have the correct MySQL username / password).
Third:
4. SSH Username = same I use to login in MySQL database with PHPMyAdmin
- See above
5. SSH Password = same I use to login in MySQL database with PHPMyAdmin
- See above
7. MySQL Hostname = my servers IP
- Usually the value for this is either localhost or 127.0.0.1 - try either of
those and see what happens.
On a personal note, I tried upgrading my version of MySQL Workbench (using OSX) and I had nothing but problems so I had to download a previous version. The only one that seems to work for me is here. If none of the suggestions I made above work for you, maybe try removing your current version and downloading an earlier version just to see if that's what's causing the problem or not.
I downloaded MySQL server 5.7 on my computer (first time) to prove it. But the installer asking me for a password for root#localHost that I have no idea where it is.
I saw a page that you can reset the password using the command line, but the command line ask me too for a password.
What I can do?
UPDATE:
You have told me that if I have not set a password , then the server does not require you to enter one, but observe ! I want to configure the program but will not let me continue !
UPDATE (SOLVED): had to reinstall the MySQL server and the problem disappeared ... (Still asking why happened that...)
Thank you all for your responses and comments!
I think that by default there is no password set for root account.
Source
https://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html
If you have never assigned a root password for MySQL, the server does not require a password at all for connecting as root.
Your default account for the connection to the service of phpmyadmin is user: root and no password. That exist for the Security of the databases
I have access to the database only through phpmyamdin. What can I do to log in via mysql-query-browser or mysql-workbench? I enter my password, username and host to mysql-workbench but there is no connection.
Thank you.
If you do not get an error any message, it sounds like there may be a firewall blocking the request on port 3306. You may also need to ask for privileges for the user/pwd that you are logging into from the host machine you are logging into.
It's possible that mysql is only listening in localhost, so you can't access it with any program that's not on the same machine as the mysql server (and phpmyadmin can access it because it's on the same server).
I normally code on windows and using MYSQL4.1. And mysql gem version is 2.8.1. In my setup when I use mysql gem to access the MYSQL server, I give the root username and password of the sql server. And in rails db config file, I give user name as 'root' and its password and host as 'localhost'. My rails server and Mysql server are running on the same machine.
But recently I had to do a project in which I had to access the MYSQL server installed at a client site. It is a linux machine. I am not sure of the sql server's version number. To access it I was given a username and password for SSH and the root username and root password of the SQL server also. But for accessing that machine, in the mysql new method I have to specify the ssh login and user-password instead of sql user and password.
I cant access the DB if I give the MySql root user and password.
So, mysql.new(machine's public IP, ssh login id, ssh login password, db_name) works whereaes mysql.new(machine's public IP, 'root, root password, db_name) does not work. I am not sure, I understand what is happening. So, my question is can anyone explain this login behavior? Why cant I access the mysql server with the sql server's root login and root password.
To expand a little bit on what adamaig said:
When you're logged into the MySQL console as root, do this:
use mysql;
select User, Host from user;
MySQL should give you a table with the accounts and their respective hosts. You'll probably see that root can only log in from '127.0.0.1' or 'localhost'. You'll also probably see another account with credentials identical to those of the ssh account that was given to you.
Also, I would advise against giving root permission to log in from everywhere, it is a security risk.
But, if you ssh directly into the machine (using something like PuTTY if you're on Windows), you'll be able to log in as root from there.
Sounds like you need to create a user in the remote db that allows remote login. The root account is typically not given permissions to login from '%' . Try looking at the mysql.user table to see what the permissions are. Then you might want to look at the mysql.com developer documents on setting up accounts and security. The answers there will be fuller than can be given here.