Could not connect to remote database - mysql

I have added the given below lines to config.inc.php file in the s C:/xampp/phpmyadmin folder and added the lines below
$i++;$cfg['Servers'][$i]['host'] = '172.16.10.100';$cfg['Servers'][$i]['user'] = 'root';$cfg['Servers'][$i]['password'] = '';$cfg['Servers'][$i]['auth_type'] = 'config';
I have encountered the following error
MySQL said: Documentation
Cannot connect: invalid settings. phpMyAdmin tried to connect to the
MySQL server, and the server rejected the connection. You should check
the host, username and password in your configuration and make sure
that they correspond to the information given by the administrator of
the MySQL server.
What could be the possible reason for this error?

As in the documentation, it seems likely that the hostname, username or password in your string are incorrect.
Do you know that they are correct? MySQL can have host-specific passwords, so connecting from one server may require a different password to connecting from another.

Related

Error after uploading laravel project from local to web server

I uploaded a laravel project from local to web server. After uploading I get following error:
SQLSTATE[HY000] [1275] Server is running in --secure-auth mode, but 'root'#'127.0.0.1' has a password in the old format; please change the password to the new format (SQL: select * from `video_categories`)
As of MySQL version 4.1, the way in which user passwords are stored was changed for greater security. By default, the server will still allow users with passwords stored in the old format to connect for backwards compatibility. However, if the server is running with the --secure-auth parameter or the secure-auth option specified in the [mysqld] section of it's option file, users that have a password stored in this old format will not be allowed to connect.
To allow the user to connect, you can either disable secure-auth mode by removing the option/parameter and restarting the server or reset the user's password with the new format. The problem with resetting the user's password is that if you do not know the existing password you will have to change it.
To reset the password, run the following command on the server in mysql:
SET PASSWORD FOR 'root'#'127.0.0.1' = PASSWORD('password');

Cannot connect: invalid settings OSX

Im getting this error but i can not find phpmyadmin folder to change config.inc.php. Any suggestion?
Error MySQL said: Documentation
Cannot connect: invalid settings. Connection for controluser as
defined in your configuration failed. phpMyAdmin tried to connect to
the MySQL server, and the server rejected the connection. You should
check the host, username and password in your configuration and make
sure that they correspond to the information given by the
administrator of the MySQL server.

Having trouble to connect to (remote) MySQL database with MySQLWorkbench

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.

host xxxx is not allowed to connect to this mysql server vb godaddy

I'm having a trouble accessing the database in my godaddy account. I already created a database in phpmyadmin and a user in mysql database
I need to access the database in my godaddy account using my localhost.
But when i run my code, i'm getting a host xxxx is not allowed to connect to this mysql server
below is what i used in config
Public consqlonline As String = "server=Website_ipAddress;user=uname;password=pass;database=syncing;Connect Timeout=2000"
you need to give a privilege to connect the specific database that the application need to connect, via PHPmyadmin >> choose database >> use privileges tab.
by the way i had this problem also and my server was running on Linux, by default the configuration of the server permit connection only from localhost, so to fix that ive edited /etc/mysql/ my.cnf file: changed the bind-address from 127.0.0.1 to 0.0.0.0 (if the version is kind of old you have to comment the "skip-networking" command

How to restore mysql users

I dropped accidentally all the users exist in my mysql DB and when I refresh the admin page I had this error :
Error
MySQL said:
1130 - Host 'localhost' is not allowed to connect to this MySQL server phpMyAdmin tried to connect to the MySQL server, and the
server rejected the connection. You should check the host, username
and password in your configuration and make sure that they correspond
to the information given by the administrator of the MySQL server.
How can I restore those users without losing my data ?
You just need to set an init file with the correct SQL to create/set a password for the root user, and then restart the server with the --init-file parameter.
Follow the directions here. Any SQL in the init file will be run, so you can create more users if you need to also.