Posted in MySQL, MySQL Shell

Create New User with admin rights on MySQL Shell

Creating new user through MySQL Shell commands below, grant access to the user then connect to MySQL (through Workbench or Shell) with that user:

MySQL JS> \sql

MySQL JS> \connect root@localhost

 

Then enter password and Y (to save the password). Or root@{ip address or hostname).

 

MySQL  localhost:33060+ ssl  SQL >  CREATE USER ‘user’@’serverhostname’ IDENTIFIED BY ‘password’;

MySQL  localhost:33060+ ssl  SQL >  GRANT ALL PRIVILEGES ON *.* TO ‘user’@’serverhostname’ WITH GRANT OPTION;

MySQL  localhost:33060+ ssl  SQL >  CREATE USER ‘user’@’%’ IDENTIFIED BY ‘password’;

MySQL  localhost:33060+ ssl  SQL > GRANT ALL PRIVILEGES ON *.* TO ‘user’@’%’ WITH GRANT OPTION;

Posted in Alexa, Alexa Lambda Function Skill, Amazon Web Service, AWS, JSON, Node.js

Create a custom Alexa Lambda Function Skill

 

  1. Login to Amazon Developer account, Navigate to “AWS Lambda”; then create a new Lambda function using a blueprint with code for the basic functions that implements a simple skill in Node.js or Python. To start with sample code, click Blueprints, then select one of the skill kits, for instance “alexa-skills-kit-color-expert”
  2. Then Enter a “name” for the function.
  3. Select the “Role”, use the role under “Existing role”.
  4. and then “Create function”.
  5. This will create a sample that we can edit later as needed.

 

Then in another browser login to your “AWS Management Console” and navigate to AWS Lambda.

  • Select “US East (N. Virginia) Region on upper-right corner of the console.

8

  • Select “Enable” for Skill ID Verification.

9

  • And copy the Skill ID from Developer Console > Your Skills > Skill-Name> Endpoint tab>

4

and past it into the Skill ID edit box as shown below:

9

  • Then click “Add” and “Save”. And copy the ARN from AWS Console and past into Skill Function > Endpoint > Default Region. In this way they can interact and handshake together.

5

 

To test our sample Lambda Function code in the Console:

10

  • In the Function list, click the function name to open the details for the function and click the “select a test event > configure test events > Create new test event > Select one of the sample Alexa requests from the Event template, I choose “Alexa Start Session” > Enter the Event name > Create.

11

Then click the “Test” button. The Execution result should be succeeded.

12

This test was for testing the interaction. To test the skill itself, we open the skill at developer amazon console; there is a “Skill builder checklist” that I modified as needed;

1

“Invocation Name” is the name of the skill to begin interaction with a particular custom skill; for instance, if invocation name is: business library then user can say: hey Alexa, open / start {Skill Invocation Name}.

2

An “Intent” represents an action that fulfills a user’s spoken request. Intents can optionally have arguments called “Slots”. For example, in a Library Skill; defining librarians contact define an intent name “librarianContact” that has slots named name or contact.

There are two json files to modify/ import the custom function skill; one in developer console to “Json editor” that defines the interaction and one at AWS Console “index.js”.

Then Click “Build Model”.

3

Then Click “Test” menu, to test the custom skill;

  • In the text box in Alexa Simulator, type: Alexa, open {Invocation Name};

It will show the content we provided in the “WELCOME_MESSAGE” in the json file (index.js).6

 

Then we can ask or type more questions to interact with the simulator.