MYSQL administrator use

  • 2020-05-06 11:48:03
  • OfStack

MySQL  
Administrator, for the rest of the time I assume that you have MySQL   Administrator installed and will use the associated legend.
500)this.style.width=500;"   border=0 >
MySQL  
Administrator main interface
Create database
To create the database, we must first connect to the server. Run MySQL  
Administrator and log in to the server.

Run MySQL   Administrator and log in to server
Select MySQL  
Administrator bottom left "Catalogs", then on the right side of the manager will appear the database directory that is already on the server. Right click "mysql" in the Schema window and select "Create  
" New   Schema ".

Create a new database
You will be prompted for the name of the database, which we use here as "mydatabase" and will use later in this article.

Enter the database name
Once created, the new database will appear in the Schema window with other databases in the server, and when selected, its details will appear in the right window.

    completes the creation of a new database:

The new database creation is completed with
There's not much more to this right now, because the database is still empty. Now let's add something to the database.
Create a table
Creating a table is as simple as clicking "Create  
Table button, the following dialog box will appear:

Create a table
As shown, we have named the table "mytable" and there are four fields, of which id field is the auto-incrementing primary key, an integer field, a text field, and a time/date field.
When you're done, click "Apply  
The "Changes" button will display the window as shown in the figure below. In the window is the SQL statement to create the table. At the same time, it asks whether to execute or not.

Confirm and execute
statement SQL in the table So far, we've created a database called "mydatabase" that contains a table called "mytable", and the next step is to add points to the database.
Add data
In the real world, adding data would be done by the application, but now it's just a matter of adding a few samples, so I'll use the insert statement of the SQL statement in the MySQL client command, if you're still at MySQL  
In Administrator, you can access the command line (Tools   - >   MySQL   Command   Line  
) from the menu "tools" Client), otherwise accessible through the MySQL group of the start menu.

Add data
through command line statements The first line of the diagram tells the server which database I'm going to use, and the second and third simply insert data into the database.
Now there are two samples of data in the data table, so far our database server has been up and running, with a database, a data table, some data.
Create a new MySQL user account,
To add a user account you need to run again and log in MySQL  
Administrator, on the left side of the MySQL   Administrator window, select "User  
Administration", and the right side will display the current account information of the server (usually called root in this case). Right click the account in the window below and select "Add   new  
User ".

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

General options such as setting username and password
When you're done, click "Apply  
Changes" button to save input.
Authorize
for user accounts New users by default can do almost nothing. To allow new users to connect to the MySQL database, they must do so in "Schema  
Privileges", which will be done in MySQL   Administrator. "Schema   Privileges".

Set the permissions
for the new account Note that there is no authorization for the user in the figure above. Since the following code needs to query the database, it is necessary to grant the user "select" permission, and then click "Apply  
" Changes" button save.
        authorization:

Authorize
Perhaps the application needs more permissions, such as "Insert", "  "Update",   and  
"Delete", etc., you can grant it to the user in the same way, but be aware that the more privileges you have, the less security you have, and you have to exercise control over every user.

Related articles: