Skip to main content

MYSQL DATABASE ENVIRONMENT BASICS

When you open the client, you will be prompted to enter the password for the root account. This is the password that was previously configured. Type the password and hit Enter.
You should see that you have entered the MySQL environment:
PHP MySQL Development Environment with UEStudio
To create a database, type the following command:
CREATE DATABASE uestudio_sample;
where "uestudio_sample" is the name of the database. Note: be sure to include the semi-colon at the end of the command.
If the command is successful you will see something similar to:
Query OK, 1 row affected (0.00 sec)
You may verify that the databases have been created by using the "Show Databases" command. If you type, "Show Databases;" and hit enter, you should see something similar to:
PHP MySQL Development Environment with UEStudio
Create a Table
For the purposes of this Power Tip, we will create a table called "names" that includes the following fields: key, first, last. You may create this table using the following steps:
Type:
USE uestudio_sample;
This will tell MySQL which database to use, then type:
CREATE TABLE names (id INT NOT NULL AUTO_INCREMENT, first VARCHAR(48), last VARCHAR(48), PRIMARY KEY(id));
We will not cover the syntax of the command (above) in the scope of this Power Tip.
If you wish to see the structure of the table, and confirm it was created correctly, type:
Describe Names;
You should see something similar to:
PHP MySQL Development Environment with UEStudio
Now, we need to insert sample data into our table. For example, if we want to create an entry to insert the name "John" (first) "Smith" (last) into the table "names", we would do so using the following command:
INSERT INTO names (first, last) VALUES ('John', 'Smith');
You may insert additional data by modifying the VALUES. Because the id is an "auto increment", we do not need to specify a value for this field.
To display all the data in the table, simply type:
SELECT * FROM names;
Because we inserted a few other names into our table, the query produced the following results:
PHP MySQL Development Environment with UEStudio
Create a User
Now that you have a database, and data, you will want to create a user (account) that will be used by the server (php) to connect to the database. You may access the database with the "root" account, however this is not typically recommended.
To create a user account you will need to use the following command line:
GRANT ALL PRIVILEGES on uestudio_sample.* to idm@'localhost' identified by 'helloworld';
"idm" is the Username and "helloworld" is the password for the user.

Comments

Popular posts from this blog

Ten output devices, advantages and disadvantages, inter-site back-up mechanism, Expert systems for medical diagnosis,information systems security

(i)Printer Printer enables us to produce information output on paper. It is one of the most popular computer output devices we often use to get information on paper - called hard copy. Advantage They produce high quality paper output for presentation at a speedy rate. It is also possible to share the printer among different users in a network. Disadvantage The cost for maintenance of the printer equipment as well printing ink is cumulatively high. (ii) Plotters These devices are used to produce graphical outputs on paper. They have automated pens that make line drawings on paper Advantage They can produce neat drawings on a piece of paper based on user commands. In Computer Aided Design (CAD) they are used to produce paper prototypes that aid in design of the final system. Disadvantage They are more expensive than printers. Further, the command based interface is difficult to use. (iii)Monitor It is...

simple basic object oriented java code for employee salary calculation

import java.io.*; import java.util.Scanner; public class Employees {     Scanner scan=new Scanner(System.in);     String Fname;   int EmpID;  int DOB; double Allowance;   double Salary;     public void getDetails(){   System.out.println("Enter the first name");   Fname=scan.next();   System.out.println("Enter the ID number");   EmpID=scan.nextInt();   System.out.println("Enter the date of birth");   DOB=scan.nextInt();   System.out.println("Enter the salary");   Salary=scan.nextDouble();   Allowance=0.6*Salary;     }    public void printReport(){    System.out.println(Fname+"\t"+EmpID+"\t"+calGross()+"\t"+calPayee()+"\t"+calNetIncome());    }    public double calGross(){        return Salary + Allowance;    }    public double calPayee(){     ...

Start Wamp server on windows automatically permanently

For those that have completely refused to use linux platforms for development, you might find this useful. As with all (aspiring) web developers, it’s always important to test your projects locally before putting it out there for the entire web community to see. One must-have developer tool for this purpose is WAMPServer. We’ve all wished it’s automatically up and running when we need it. These easy steps will help you automate WAMPServer to run on system start-up. For those unfamiliar with WAMPServer, it is a development package that lets you run web development projects locally. WAMP stands for Windows, Apache, MySQL, PHP/Perl/Python. It’s basically four programs packaged to work as one. WAMP basically turns any Windows PC into a localized web server. The Linux counterpart is called LAMP, obviously. Once WAMPServer is installed in your PC, you’ll be able to test your web projects before putting it into the live environment. But I always found it a hassle to manually s...