Quick up my hands Mysql - Drawing Operation

xiaoxiao2021-03-06  14

First, mysql download and installation

1, download introduction

MySQL believes that everyone must have heard that if you don't know what it is doing, you can go Google.

Mysql's big camp:

http://www.mysql.com/

MySQL download address:

Http://dev.mysql.com/downloads/ Because there are many stuffs from this address, this page is analyzed in detail.

● About the mirror site, there is no mainland, there are Hong Kong and Taiwan. Select it, in order to speed up the download speed, but it is not absolute, I often download from North America, the speed is faster.

● MySQL Database Server Here I selection Mysql 4.1. The version is too low, many new features can not be used; too high, the test is not perfect, it is easy to make BUG. Here is recommended here.

Click this link to enter the download page, you can see that the current version is 4.1.8. turn up"

Windows Downloads, as shown, because I am using a Windows platform. Here I choose "

This version of WITHOUT INSTALLER ", because I like the software that doesn't have to be installed, I am not happy, I can delete it directly, of course, I need to configure it yourself.

Click "Pick a mirror", enter a page, where the table can be filld, and you can choose a link to download it. The downloaded file name is "mysql-4.1.8-win-noinstall.zip", the size is 35.2m.

● About "

Graphical client, client, select one, can make a graphical operation, why not? Just before I have been using "mysql control center", but now I don't develop. Select "MySQL Administrator" The downloaded file name is "mysql-administrator-1.0.19-win-noinstall.zip" (here I chose no installation version), the size is 4.5m.

Also select "MySQL Query Browser", it is to query. The downloaded file name is "mysql-query-browser 1.1.5-win-noinstall.zip" (no installation version), the size is 4.5m.

About this area is more software, such as: MySQL-FRONT, EMS MYSQL Manager, etc., it is better, but they are Money.

"

Application Programming Interfaces (APICI) Application Interface Since I mainly facing Java applications, I choose "

MySQL Connector / J ", version select" MySQL Connector / J 3.0 "because it is a" ProCDUTION "version. The downloaded file name is" mysql-connector-java-3.0.16-ga.zip ", the size is 1.2m .

2, install mysql

· Find the downloaded mysql-4.1.8-win-noinstall.zip, unzipped to the D disk, is a "mysql-4.1.8-win" folder, here I rename it "mysql", because I don't like it With version number. That is, it is "D: / MySQL" directory, there is a "data" directory in this directory, where it is where data is stored. For your convenience backup and upgrade, it is best to put it elsewhere. Here I am now built a directory "MySQL-DATA" in the D disk, then cut the "DATA" subdirectory under the "D: / MySQL" directory to the "D: / MySQL-DATA" directory. · Create a new "My.ini" file, pay attention to the hyperfix name "INI". The content is as follows:

E: /Windows/my.ini

[Winmysqladmin] server = d: /mysql/bin/mysqld-nt.exe [mysqld] basedir = d: / mysql datadir = d: / mysql-data / data

The above "server" points

Mysql's execution master, "Basedir" points to the mysql installation directory, "DATADIR" points to the MySQL's data storage directory (because I have changed it, so I need special specified).

Then move this file to

WINDOWS system installation directory, I am "e: / windows".

· Open the MS-DOS window, switch to the "D: / MySQL / BIN" directory; or add "D: / MySQL / BIN" to "Path" variables of "Environment Variable", which avoids switching to "D: / mysql / bin directory.

· Add to Windows XP service:

D: / mysql / bin> MySQLD-NT -INSTALL

(Open "Control Panel" -> Management Tool -> Service: You can see that there is a "mysql" service in the service list. If you don't want it to be automated, you can change it manual, you can save some memory when you don't need it.)

· Start and stop MySQL service D: / mysql / bin> Net start mysql d: / mysql / bin> Net Stop MySQL

· Shift from MySQL services

MySQLD-NT --Remove

(If you no longer need mysql, stop MySQL service first, then remove the mysql service, finally remove the mysql installation directory)

Second, basic operation

Ready to work

Create a MySQL-Software catalog in the D disk, copy the mysql-administrator-1.0.19-win-noinstall.zip just downloaded to this subdirectory, decompressed, get a directory of MySQL Administrator 1.0.

Also do this time mysql-query-browser-1.1.5-win-noinstall.zip, get a directory of MySQL Query Browser 1.1.

Start service:

· Double-click the mysqlsystemtrayMonitor.exe under the D: / MySQL-Software / MySQL Administrator 1.0 directory, and an icon will appear on the right side of the task bar. Click "Start Instance" and run mysql.

· Then double-click the mysqladministrator.exe in the D: / MySQL-Software / MySQL Administrator 1.0 directory, or directly click on "MySQL Administrator" in the right-click menu:

· Create a connection name, you can fill in it, here is "mxj", username: root, password is empty. This is because MySQL has a root account with no password by default. Click "OK" and the management window appears: this is nothing to say, English is also very simple. Just talk about two items cheated above.

change Password

Ok, the password for my root account is set to: JavaMxj, click on "Apply Change".

● Initial database

The figure above can be seen that there are two databases in the initial, and the mysql library contains various configuration information, do not perform table operations in this library.

The TEST library is initially empty.

In addition, when establishing a table, don't name the name in the mysql library, so as not to conflict.

Data creation and query (talk about character encoding)

· Now come to the search browser, or right, right-click the "MySQL System TRAY MONITOR" icon, and select "MySQL Query Browser" because it has changed the root password, so you have to fill in the new password.

· Enter the main interface, right-click the TEST database, create a new table.

· Create a table as follows

· Switch to "Table Options":

If you understand the database, these should be very familiar, not to say. Note that the character settings are "latin1" (saving changes) (Switch to this column again).

· Fill in some test data:

· Close "MySQL Query Browser", reopen it again, switch to the TestTable table, haven't seen it? The Chinese just entered into "??????", why? Switch again to "Table Options":

Know why, the original default character is "latin1", because MySQL is a product of a company in Sweden. The Chinese seem to work hard!

● Solution:

· Stop MySQL service, close all procedures related to MySQL, open

The My.ini file in the system installation directory of Windows is modified as follows:

E: /Windows/my.ini

[Winmysqladmin] server = d: /mysql/bin/mysqld-nt.exe [mysqld] basedir = d: / mysql datadir = d: / mysql-data / data

Default-character-set = GBK [client] default-character-set = GBK

The meaning of the two statements added is to encode the GBK character set in the client and the server.

After saving, reactivate the MySQL service, open "MySQL Query Browser", create a table again, enter Chinese, everything OK!

postscript

Regarding how the DOS side is used to use the command line for MySQL operation, this is not discussed here, there are many information on the Internet. There are many software for the graphical interface for mysql operation, but most of them need to be broken. Look at it yourself.

As for mysql-connector-java-3.0.16-ga.zip this file, it will be used when developing EJB later, and then said.

转载请注明原文地址:https://www.9cbs.com/read-48221.html

New Post(0)