Home > Database > Mysql Tutorial > body text

Mysql download, installation, deployment and graphical detailed operation tutorial_MySQL

WBOY
Release: 2016-08-20 08:48:13
Original
1201 people have browsed it

Mysql is a tool that you must learn how to install and deploy. It is different from other fool-like applications/programs. It can be completed with one click. It is still difficult for beginners to install Mysql under Windows for the first time.

This article cooperates with the deployment of the front-end development environment in the previous article "Javaweb Development Environment Myeclipse6.5 JDK1.6 Tomcat6.0 SVN1.8 Configuration Tutorial" (click to open the link), thus forming the basic development of JavaWeb, JSP, and J2EE environment.

1. Download Mysql

First open the official website of Mysql (click to open the link). You can’t find it on Baidu. I also searched for a long time before I found the official website of Mysql5.1. I chose the version of Mysql5.1. The better the version, the better. The key is It’s stable


Choose the installation version of Mysql with MSI as the suffix. This thing is not like Tomcat. It is better to configure it according to the installation wizard.

Choose the corresponding version according to the different versions of the 32-bit operating system and the 64-bit operating system, but it seems that the problem is not big. The author personally tested the installation of 32-bit Mysql on a 64-bit machine, and there was no problem at all.

2. Mysql installation

1. After successfully downloading, you will get a mysql-5.1.73-win32.msi. Double-click to open it. The following will use Mysql5.0 as a screenshot to explain the installation of Mysql. After all, other versions of Mysql are similar or even no different


2. Run "setup.exe", the following interface will appear, the mysql installation wizard starts, press "Next" to continue:


3. Select the installation type. There are three options: "Typical (default)", "Complete (complete)", and "Custom (user-defined)". We choose "Custom", which has more options and is convenient for familiar installation. process.


4. Left-click on "Developer Components" and select "This feature, and all subfeatures, will be installed on local hard drive.", that is, "This section, and the contents of its subordinate subsections, all Installed on local hard drive", which is the second one. Developer Components (developer section) are turned off by default. Check the above "MySQL Server (mysql server)", "Client Programs (mysql client program)", "Documentation (documentation)" and do the same to ensure that all files are installed. Click "Change..." to manually specify the installation directory. If you want to change the installation path of Mysql, you need to change all parts of the directory, not just one!

5. Press "Next" to continue and confirm the previous settings. If there is an error, press "Back" to return and redo. Press "Install" to start the installation.


6. Next, start the installation. Mysql is not big and the installation is completed quickly. It does not take a long time to install like Sql Server 2005


7. Some old versions of Mysql may also display the following interface during this process:


Here you are asked whether you want to register a mysql.com account, or use an existing account to log in to mysql.com. Generally, this is not necessary. Click "Skip Sign-Up" and press "Next" to skip this step.

8. Until the software installation is completed, the following interface appears. There is a very good function here, the mysql configuration wizard. You don’t have to manually configure my.ini as before. Just put "Configure the Mysql Server now" in front of it. Check the box, click "Finish" to end the software installation and start the mysql configuration wizard.


9. The following is the mysql configuration wizard startup interface, press "Next" to continue.


10. Select the configuration method, "Detailed Configuration (manual precise configuration)", "Standard Configuration (standard configuration)", we select "Detailed Configuration" to facilitate familiarity with the configuration process.


11. Select the server type, "Developer Machine (development and testing type, mysql takes up few resources)", "Server Machine (server type, mysql takes up more resources)", "Dedicated MySQL Server Machine (specialized database server, mysql Occupy all available resources)", everyone chooses according to their own type, generally choose "Server Machine", it will not be too few, and it will not be full.


12. Select the general purpose of the mysql database, "Multifunctional Database (general multi-functional, good)", "Transactional Database Only (server type, focused on transaction processing, general)", "Non-Transactional Database Only (non-transaction processing) Type, relatively simple, mainly used for monitoring and counting. The support for MyISAM data types is limited to non-transactional). You can choose it according to your own use. I choose "Transactional Database Only" here and press "Next" to continue.


13. Configuring the InnoDB Tablespace is to select a storage space for the InnoDB database file. If it is modified, remember the location and choose the same place when reinstalling, otherwise the database may be damaged. Of course, do the database A backup is no problem, so I won’t go into details here. I have not modified it here. I use the default location and press "Next" to continue.


14. Select the general mysql traffic of your website and the number of simultaneous connections, "Decision Support (DSS)/OLAP (about 20)", "Online Transaction Processing (OLTP) (about 500)", "Manual Setting (Manual setting, enter a number yourself)", I choose "Online Transaction Processing (OLTP)" here, my own server should be enough, press "Next" to continue


15. Whether to enable TCP/IP connection and set the port. It is best not to change the port number here. After all, it is generally believed that Mysql occupies port 3306. This port is as great as the jerseys of some players on the football field and basketball court! If it is not enabled, you can only access the mysql database on your own machine. I enable it here and check the previous box. Port Number: 3306. On this page, you can also select "Enable Strict Mode" ) so that MySQL will not allow minor syntax errors. If you are still a newbie, I suggest you cancel the standard mode to save yourself trouble. But after becoming familiar with MySQL, try to use the standard mode because it can reduce the possibility of harmful data entering the database. Press "Next" to continue.


16. This is more important, which is to set the default database language encoding of MySQL. The first one is Western latin1 encoding, and the second one is multi-byte universal utf8 encoding. You can choose it directly. You can also choose the third one here. Then select or fill in "utf-8" in the Character Set. "gbk" and "gb2312" are obsolete. Now websites are written in internationalized utf-8. For some installed old databases mysql, before executing the data operation command, you need to run "set names utf-8;" (just run it once, utf-8 can be replaced with other values, depending on the settings here) , you can use Chinese characters (or other characters) normally, otherwise Chinese characters cannot be displayed normally. If you store things as garbled characters when programming, not only may there be problems with your own program, but there may also be problems with Mysql. Press "Next" to continue.


17. Choose whether to install mysql as a windows service, you can also specify the Service Name (service identification name), and whether to add the bin directory of mysql to the Windows PATH (after adding it, you can directly use the files under the bin without pointing out the directory name, for example, "mysql.exe -uusername -ppassword;" for connection. You don't need to point out the full address of mysql.exe, which is very convenient). I have checked all the boxes here, and the Service Name remains unchanged. If you don't start it, you have to start the service manually every time you use Mysql. Starting a service in Windows is very troublesome. If you don't want to install MySQL and cause your own operating system to get stuck, you'd better install MYSQL in a virtual machine and use it as your own development environment. Press "Next" to continue.


18. This step asks whether you want to change the password of the default root user (super administrator) (the default is empty). If you want to change the "New root password", fill in the new password here (if it is a reinstallation, and it has been set before You may make an error when changing the password here. Please leave it blank and remove the check mark in front of "Modify Security Settings" (change the password separately after the installation and configuration is completed). Fill in "Confirm (enter it again)" again to prevent Wrong entry. "Enable root access from remote machines (whether to allow root users to log in on other machines, if you want security, don't check it, if you want convenience, check it)". Finally, "Create An Anonymous Account (create a new anonymous user, anonymous users can connect to the database, but cannot operate data, including queries)" generally does not need to be checked. I usually set the user name to root and the password to root. Please remember this password, it will be very troublesome if you forget it. After setting is completed, press "Next" to continue.


19. Confirm that the settings are correct. If there are errors, press "Back" to return to check. Press "Execute" to make the settings take effect.


20. After the settings are completed, press "Finish" to end the installation and configuration of mysql - there is a common error here, that is, you cannot "Start service", which usually occurs on servers where mysql has been installed before. The solution is to ensure first The previously installed mysql server has been completely uninstalled; if not, check whether the previous password has been modified as mentioned in the step above, and follow the above operations; if it still does not work, back up the data folder in the mysql installation directory, and then delete it. , after the installation is completed, delete the data folder generated by the installation, move the backed up data folder back, and then restart the mysql service. In this case, you may need to check the database and then repair it to prevent data errors. . At this point, the installation and configuration of Mysql is completely completed.


3. Basic use of Mysql

Now Mysql can be used. Open Mysql->Mysql Command Line Client directly in the start menu, enter the password you just set, and you can use T-SQL statements to operate. MYSQL does not have a graphical interface without installing plug-ins. MYSQL uses a semicolon; to end a statement, not the Enter key. In addition to basic T-SQL statements, and the set encoding statement set names utf-8; just mentioned, Mysql also has the following statements:
 Show databases: show databases;
 Use databases: use database name ;
      Database creation command: create database shujuku;
Set permissions (user and password) for the database command: grant all privileges on shujuku.* to test@localhost identified by “123456”;
When you finish executing this command In the future, as long as you log in with username: test and password: 123456, you can only operate on the shujuku database. This avoids using root and is of great help to the security of the database. However, for the sake of convenience during general development, there is no need to set permissions like this. It is not like Sql Server 2005, which must open permissions before it can be called by external programs.
Enter "?" on the command line, and there will be simple help for the mysql command. To exit, it is "exit".


4. Mysql graphical

The so-called Mysql graphical installation is actually not as difficult as the installation of Mysql. You don’t even need to install it, it’s just a matter of decompressing the compressed package,

Please search for mysql-gui-tools-noinstall-5.0-r12-win32.zip on the Internet. Green versions are available for download from major websites.

It is best to use graphics. This does not mean that you should not use graphics if you are proficient in T-SQL statements. The key is that the work efficiency of graphics is significantly improved compared to entering commands!

After decompressing mysql-gui-tools-noinstall-5.0-r12-win32.zip, the key is two programs:


One is MySQLQueryBrowser.exe, which is used to view and look up tables. Enter the database and set the port number during installation. The first item of the port number is usually localhost. User name and password can easily view the database tables. If you don't you will need to use T-SQL to view the table.


One is MySQLAdministrator.exe. After entering the user name and password set during the database installation as above, you can use Restore to import the database and Backup to export the database. It is very simple. If you don’t use it, you need to do something like Export and import like "MySQL command line export and import database" (click to open the link).

At this point, all Mysql installations are complete!

The above is the entire content of this article. I hope it will be helpful to everyone’s study and I hope you will support me a lot.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template