Use MySQL Administrator

Source: Internet
Author: User
Tags mysql command line

MySQL
Administrator. For the rest of the time, I assume that you have installed MySQL administrator and the related legends will be used.
500) This. style. width = 500; "border = 0>
MySQL
Administrator Main Interface
Create a database
To create a database, you must first connect to the server. Run MySQL
Administrator and log on to the server.

Run MySQL administrator and log on to the server
Select MySql
"Catalogs" at the bottom of the left side of the Administrator, the database directory already exists on the server on the right side of the manager, right-click "MySQL" in the schema window, and select "create
New schema ".

Create a new database
The system will prompt you to enter the database name. Here we use "mydatabase", which will be used later in this article.

Enter Database Name
Once created, the new database will appear in the schema window with other databases on the server. After you select it, its details will appear in the window on the right.

Create a new database:

The new database has been created.
There is nothing more here, because the database is still empty. Next we will add something for the database.
Create a table
Creating a table is simple. You only need to click "create
Table, the following dialog box is displayed:

Create a table
We have named the table "mytable", which has four fields. The ID field is the primary key for auto increment, an integer field, a text field, and a time/Date Field.
After completing these steps, click "apply
The Changes button appears, as shown in the window where the SQL statement for creating the table is displayed, and whether to execute the statement. Of course, click "execute ".

Confirm and execute the SQL statement in the table
So far, we have created a database named "mydatabase" that contains a table named "mytable". Next, we need to add point data to the database.
Add data
In actual situations, the data is added through the ApplicationProgramBut now we only need to add a few sample data, so I will use the insert statement of the SQL statement in the mysql client command.
In administrator, you can access the command line (tools-> MySQL Command Line) through the menu "Tools ".
Client). Otherwise, you can access it through the MySQL group in the Start Menu.

Add data using command line statements
The first line in the figure is to tell the server that I will use the database, and the second and third are simply inserting data into the database.
Now there are two sample data in the data table. So far, our database server has been established and run, and there is a database, a data table, and some data.
Create a new MySQL user account
To add a user account, run it again and log on to MySQL.
Administrator, select "user" on the left of the MySQL administrator window
"Administration", and the right side will display the current server account information (usually called root), right-click the account in the window below, and select "Add new
User ".

Run MySQL again
And add a user account
Next, the system will prompt you to enter the details of the new user. I will name the new user "15 secs" and set the password to "password ".

Set common options such as user name and password
After completing these steps, click "apply
Changes button to save the input.
Authorize a user account
By default, almost no new users can do anything. To allow new users to connect to the MySQL database, they must
Privileges ", which will be completed in" schema privileges "in MySQL administrator.

Set permissions for new accounts
Note that no authorization has been made for the user.CodeTo query the database, you must grant the "select" permission and then click "Apply ".
The Changes button is saved.
Authorization:

Authorize
Maybe the application requires more permissions, such as "insert", "Update", and
"Delete" and so on, you can grant the same method to the user, but note that the more permissions, the less security, you must control each user.

Related Article

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.