Database Operations in JSP (1): MySQL database creation and management

Source: Internet
Author: User

Directory order:

Install MySQL

MySQL management software SQLYog Enterprise

-- 30-day trial expiration Solution

Use SQLYog Enterprise to create a database

MySQL Parameters


1. Install MySQL
Download and install. Configure the user name and password during installation. Remember your configuration.

2. MySQL management software SQLYog Enterprise
MySQL is a command line page, which is inconvenient to manage. Therefore, we use a GUI software SQLYog Enterprise to manage databases. SQLYog Enterprise is a powerful database management software that allows you to easily create, modify, delete, and rename databases.
2.1 30-day trial expiration Solution
Enter regedit at run to open the registry, delete the value in REGISTRY \ HEYK_CURRENT_USER \ Software \ {FCE28CE8-D8CE-4637-9BC7-93E4C0D407FA}, and count again in 30 days. It can be used all the time.

3. Use SQLYog Enterprise to create a database
3.1 create database
Right-click the blank area on the left panel, select Create Database, and enter the Database name in the pop-up box. The character set that can be used in Datebase charset. To avoid Chinese garbled characters, we recommend that you use the same character set as in the web page. Click Create after setting.
3.2 create table
Use a previously created database named news for demonstration. Click the plus sign on the left side of news, select table in the displayed folder list, right-click table, and select Create Table from the pop-up menu.

Enter the table column name and attributes on the page that appears.
Field Name is the column Name. Datatype is of type. Len indicates the allowed content length. The primary Key is the primary Key. A primary key is an identifier in a database. The primary keys of each row must be different.
We create four columns.
The first column is id, integer type, set as PK, And Check auto increase. This will automatically fill in the value when new data is created.
The second column is title and char type, which stores text.
The third column is content and varchar. Because the char type can be up to 255 bytes, The varchar type is required for a longer period.
The fourth column is time, which is set to Datetime type. Datetime can represent the year, month, day, hour, minute, and second.


After setting, click Create at the bottom, enter the table name, and save it. (Warning: do not fill in the upper right corner of the cross, you know the consequences)
3.3 Add data
Select the newly created Table, and select Table Date in the third column on the right. Double-click the corresponding location to insert data. Click Save after insertion. The value set to auto increase is automatically increased.

4. MySQL Parameters
Open my. ini in the root directory of MySQL to view MySQL parameters.
Port: port = 3306 www.2cto.com
Set the default character set: default-character-set = utf8
Database storage location: datadir = "C:/Documents and Settings/All Users/Application Data/MySQL Server 5.1/Data /"
By: shirenfeigui

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.