Can i connect to my MySql Server using workbench without having a password - mysql-workbench

I have a MySql database that is running on a linux server. The DB is not password encrypted.
I understand that no password != empty password.
I installed mysql workbenck on my windows laptop and am trying to connect to my database. It doesn't allow me to.
Details:
Connection method: Standard (TCP/IP)
Error: Cannot connect to Database server
Your connection attempt failed for user'root' from your host to server at 3306
Host is not allowed to connect to this MySql Server.
I am supposing it might be a windows firewall issue.
Please can somebody help me resolve this.

The error message says it clearly: the machine you are connecting from is not allowed to connect. In a MySQL server you can create users with specific IPs they can connect from. Often only localhost access is enabled (user#localhost or user#127.0.0.1 or user#::1), sometimes anyhost (user#%). In order to connect from your Windows machine your user must either be allowed to connect from any host or you need a specific user for the IP address of your Win machine.

The error because the mysql server is not starting in your computer.so you can start it manually..do the following steps,
1.download and install wamp server according to your bit version(32bit or 64bit) in your computer(http://wampserver-64bit.en.softonic.com/) this link allows you to download wamp server for 64bit.
2.As soon as you install it you can double click and run it..(you can see a icon in the right hand of the taskbar.It may be hide.so you can click the arrow which dhows you the hide apps runing).So click the icon and go to Mysql
3.Then go to Service and there you can find Start/Resume Services click on it..
4.And now it is done.Open mysql workbench and see.It will work..

You should create an specific user for accesing from your laptop:
CREATE USER 'youruser'#'machine.domain.com' IDENTIFIED BY 'your-password';
GRANT ALL PRIVILEGES ON *.* TO 'youruser'#'machine.domain.com' WITH GRANT OPTION;
Or you could create an user for accesing from anywhere
CREATE USER 'new_user'#'%' IDENTIFIED BY 'my-password';
GRANT ALL PRIVILEGES ON *.* TO 'new_user'#'%' WITH GRANT OPTION;

Related

Postgres - connection timeout

When I trying connect to my postgres database, I always receiving connection time out error. For instance I want to connect from pqadmin. Can you please help with it ?
PostgreSQL databases on PythonAnywhere are protected by a firewall, so external computers can't access them directly -- you need to use a thing called an SSH tunnel, which opens a secure SSH connection to PythonAnywhere, then sends the Postgres stuff over it.
This help page on the PythonAnywhere site has the details on how to set that up.

Tableau Desktop connection to PostgreSQL DB using Certificate Authentication over SSL/TLS

I connect to my PostgreSQL databases (which run on AWS EC2 instances) using certificate authentication (and not passwords). An example of a psql command I would use to connect to one of my databases is:
psql "host=<AWS EC2 instance> user=<db user> sslcert=<path to .crt> sslkey=<path to .key> sslrootcert=<path to .crt> sslmode=require dbname=<db name>"
I would like to be able to connect Tableau Desktop to one of my databases. The standard PostgreSQL connector does not allow me to specify which SSL certs to use (but it does have a Require SSL checkbox - which I think is for encryption not authentication).
So I have tried to use the ODBC connector. I make the following entries:
Connect Using
Driver: PostgreSQL Unicode
Connection Attributes
Server: <AWS EC2 instance>
Port: 5432
Database: <db name>
Username: <db user>
String Extras: sslcert=<path to .crt>; sslkey=<path to .key>; sslrootcert=<path to .crt>; sslmode=require
By much trial and error I think the String Extras require a semicolon as a delimiter, but I still cannot connect. I get the error message:
An error occurred while communicating with Other Databases (ODBC).
Unable to connect to the server. Check that the server is running and that you have access privileges to the requested database.
FATAL: connection requires a valid client certificate
Generic ODBC requires additional configuration. The driver and DSN (data source name) must be installed and configured to match the connection.
Unable to connect to the server "<AWS EC2 instance>" using the driver "PostgreSQL Unicode". Check that the server is running and that you have access privileges to the requested database.
I would be really grateful to hear from anyone who has connected Tableau Desktop to PostgreSQL using certificate authentication and could tell me what I’m doing wrong. Cheers!
I managed to fix this myself, and just in case there's someone out there who might be vaguely interested I'll go through the salient features:
1. Created a DSN (Data Store Name)
This made testing much easier rather than constantly retyping details into dialog boxes.
Rather than create manually I used this: http://www.odbcmanager.net/
On Mac OS I had to run it as sudo from the terminal or it wouldn't create anything.
I created a User DSN, which on my Mac have details stored in /Users/<user name>/.odbc.ini
It picked up the PostgreSQL Unicode driver that I'd previously installed. On Mac OS you might need to do brew install brew install psqlodbc and/or brew install unixodbc
Most of the configuration was specified by adding key/value pairs e.g. DBNAME <db name>
Set SSLMODE verify-ca (changed from require to make behaviour specific - psql assumes verify-ca/verify-full if SSL certs are supplied)
The cert paths are set with key Pqopt, value sslcert=<path to .crt> sslkey=<path to .key> sslrootcert=<path to .crt>. Must be lower case and only spaces between entries!
Here's what it added to my user's odbc.ini file:
[<DSN name>]
Driver = <path to driver, this was mine /usr/local/lib/psqlodbcw.so>
Description = <description>
SSLMODE = verify-ca
HOST = <host>
DBNAME = <database>
PORT = 5432
UID = <db user>
Pqopt = sslcert=<path to .crt> sslkey=<path to .key> sslrootcert=<path to .crt>
2. Tableau Desktop Connection
Select Other Database (ODBC) connector.
Select the DSN you created previously (it should be automatically picked up), it will automatically populate host, port, db and user fields, then click Sign In.
Once signed in behaviour was slightly different to the dedicated PostgreSQL connector. Tables did not appear on left-hand side initially. But they are accessible - they can all be displayed by clicking on the 'contains' radio button and searching with a blank name.
Hope this helps. Let me know if you've got any questions.

PostgreSQL and Tableau

I'm trying to connect my Tableau desktop to a PostgreSQL database on a virtual machine. I keep getting this error unable to connect to the server "xx.xx.xxx.xxx". Check that the server is running and that you have access privileges to the requested database. Is there any way to solve the problem?
I have enabled access in the virtual machine via the pg_hba conf file and I can access it from pgAdmin4 in my PC.
For the server text box in tableau, I'm just putting the IP of the virtual machine. The rest of the boxes are just default settings (besides password).

Connecting to Google Cloud SQL with MySQL Workbench

I can't seem to connect to Cloud SQL with Workbench. I keep getting this error.
Failed to Connect to MySQL at CLOUD-SQL-IPv4:3306 with user root
Access denied for use 'root'#'WHITE-LISTED-IP-ADDRESS' (using password: YES)
I have white listed my IP.
I have set an IP for the SQL instance.
I have checked the username and Password several times.
Any idea why this is happening?
It seems you have to create a new user in the Google Cloud Console with the host name set to %(any host). You can't seem to connect using the root user.
Is it possible to connect with the #root user but after you finish the setup you have to restart the sql server.
What is important to set up an SSL certificate if you connect to you production database, but if you only try it out you can allow unsecured connection. Another important thing is to add your IP to the Authorised Networks in the Connection tab.

Cannot connect to Tryton database

After installing the standard Tryton packages in Ubuntu 12.04, I can start the client and create a new database. But the client refuses to connect to the database. It will display the locally created databases, but will fail to add the localhost profile.
If I try to add a new profile, the client will show the installed databases, but on clicking ok will fail silently back to the start screen, without adding the new profile.
New profile setting was:
Hostname: localhost
Port: 8000
Database: [Correctly displays the list of created Dbs]
Username: [I've tried everything from tryton, admin, test to root]
I have also tried to connect directly in the Tryton client without adding a new profile, then it will always yield "Bad user or password", no matter how exact I re-enter the tryton user with his password, or any other user (admin, root) for that matter.
I have followed the procedure in the documentation (Readme.debian: adding database user in /etc/trytond.conf and so forth, have registered tryton user with postgres and in trytond.conf).
Do I need to be logged in as tryton on Remote Desktop maybe?
The client was started on the Ubuntu desktop via Remote Desktop, logged in as root.
Tried to log in as tryton, too. That will get to the desktop, but somehow not show the Terminal window. Hence I can't start the Tryton client. Terminal will blink for a second and then vanish.
When you create a dabatase from the tryton client it ask you the admin password. You must enter with the 'admin' username and with the admin password you used on the database creation step.
Once you enter the system you will see and step to create additional User. You can skip it if you want, as they can be created at any time from Administration -> Users -> Users menú.
You must never use the passwords entered on etc/trytond.conf as this credentials are used from the tryton server to conect to the database. User logins are managed by tryton server.