Configuring Code Insight using MySQL Commands

Code Insight 6.14.2 SP2

The following table describes common MySQL commands and how to use them to configure Code Insight.

Common SQL Commands

Command

Code

Create Database

CREATE DATABASE <the database name>;

For example:

CREATE DATABASE Code Insight;

Make sure the user has permissions to create a new database.

Create User and Grant All Privileges

Access from a specific server:

CREATE USER 'user'@'server' IDENTIFIED BY 'password';

Access from any server:

CREATE USER 'user'@'%' IDENTIFIED BY 'password';

GRANT ALL PRIVILEGES ON *.* TO 'user'@'server' WITH GRANT OPTION; FLUSH PRIVILEGES;

Default User and Password

On Linux, the default user for most Linux MySQL installs is root the password is blank.

On Windows, Windows prompts for user name and password during the setup process.

Execute the SQL Scripts

mysql -h <the host> -u <the user> -p <the database> < <path to script file>

You can use this command to execute the Code Insight SQL scripts from command line.

List All Database for MySQL Instance

SHOW DATABASES;

This will list all databases. After running the create database command, you can use this to verify it was successfully created.

Log into MySQL

mysql -h <the host> -u <the user> -p <the database>

Note:The -p option prompts for a password when you hit Enter; the statement that follows -p is the name of the database not the password.