Ssl integration with mysql - Access denied

I am trying to configure ssl for mysql by going this .
I can follow the first 3 steps, but the problem is with 4th, which looks like this:

 GRANT ALL PRIVILEGES ON *.* TO 'ssluser'@'localhost' IDENTIFIED BY 'ssluser' REQUIRE SSL; FLUSH PRIVILEGES; 

Then I restart the mysql server.

After executing this statement, when I try to run mysql -ussluser -pssluser -P3306 --ssl-key="C:\Program Files\MySQL\MySQL Server 5.5\certs\ca-cert.pem" , it displays the following error: Access denied for user 'ssluser' @ 'localhost' (using password: YES)
I use 3306 here as this is my default port.

How can Access Denied say it when I have already executed the GRANT statement.

note that

  • I executed mysql -ussluser -pssluser before using the GRANT statement with REQUIRE SSL and I was able to connect to mysql .

  • If I try SHOW GRANTS FOR 'ssluser'@'localhost';
    I get

     GRANT ALL PRIVILEGES ON *.* TO \'ssluser\'@\'localhost\' IDENTIFIED BY PASSWORD \'*C56A6573BEE146CB8243543295FD80ADCE588EFF\' REQUIRE SSL WITH GRANT OPTION 
  • Before executing the GRANT statement, I was able to connect to the workbench via ssluser. But now his refusal has refused .

  • When I use show global variables like 'have_%ssl'; , I get

    has_openssl DISABLED has_ssl DISABLED

  • and when I use this SHOW STATUS LIKE 'Ssl_cipher'; , I get

    Ssl_cipher _________

  • I created all the server and client certificates and placed them in the certs directory inside the mysql server root directory.

I have been trying since two days, but have not found anything. Any help was appreciated.

I am doing this for the first time. Can someone guide me through the detailed procedure for this?

+6
source share
1 answer

Today I struggled with a similar error message, and here is what I found.

  • The "REQUIRE SSL" option for GRANT requires only SSL to connect and does not require a client-side certificate.
  • Mysql CLI does not handle SSL as I expected. For example, in MySQL 5.5, the --ssl parameter does not seem to really support SSL transport.
  • I had to add the option --ssl-cipher=DHE-RSA-AES256-SHA:AES128-SHA to force the mysql client to really use SSL and allow authentication with the client.

Here are the exact steps that I used to configure my new user:

 CREATE USER 'ssl-user'@'%' identified by '<password>'; GRANT USAGE ON *.* TO 'ssl-user'@'%' identified by '<password>' REQUIRE SSL; GRANT ALL PRIVILEGES ON `your-database`.* TO 'ssl-user'@'%'; 
+6
source

All Articles