Mysql 5.7.18 installation method and MySQL Service Startup Process details, 5.7.18mysql

Source: Internet
Author: User

Mysql 5.7.18 installation method and MySQL Service Startup Process details, 5.7.18mysql

MySQL is a very powerful relational database. However, some beginners may encounter various difficulties when installing the configuration. Here we will not talk about the installation process, but about the configuration process. MySQL files downloaded from the official website are in the msi and zip formats. Run and install Msi directly, and unzip the zip file to your favorite directory address. You must configure these two methods before using them. The following describes the default address in msi format: C: \ Program Files \ mysql-5.7.18-win32.

1. After installation or decompression, You need to configure the environment variables as follows: My computer> Properties> advanced system Settings> advanced> environment variables. Click path in the system variable and select edit. Append C: \ ProgramFiles \ mysql-5.7.18-win32 \ bin. What you need here is not overwrite! In addition, it is best to append at the beginning. The English Semicolon ";" cannot be missed. (It can also be inserted in the middle, but remember to append it after .)

2. Click Start Menu, search for cmd.exe, and click left to run as administrator. Be sure to run as administrator !!!

If you run cmd directly, the following error occurs when you enter mysqld-install: Install/Remove of theService Denied!

When you enter mysqld-install correctly and press enter, The service already exists is displayed!

3. Enter net start mysql to start the server. If the server fails to be started, as shown in.

This is because in versions above 5.7, C: \ Program Files \ mysql-5.7 + directory does not have data folder, in this, remember not to copy other versions of mysql data folder, enter mysqld -- initialize-insecure -- user = mysql in the window. Note that there is a space in front of "--" and press Enter. (Wait for half a minute to check the computer speed)


(In the C: \ ProgramFiles \ mysql-5.7.18-win32 directory, no data folder is displayed. For example)


Note: In versions earlier than 5.7, You need to modify the mysql-5 under the C: \ ProgramFiles \ my-default.ini. * directory, right-click Edit

Basedir = ......
Datadir = .....

Change

basedir= C:\Program Files\mysql-5.*datadir= C:\Program Files\mysql-5.*\data

Where "C: \ Program Files \ mysql-5. *" is determined by the actual installation location

4. In the C: \ ProgramFiles \ mysql-5.7.18-win32 directory, the data folder is successfully created.

After the data is created, enter mysqld-install and press enter (if it is successfully started in step 3, you do not need to enter it again)

5. After the service is successfully started, you can log on. Enter mysql-u root-p and press Enter. Enter password is displayed. Because no logon password is set, you do not need to Enter anything. Press Enter.

Press enter. For example, the mysql configuration has been successful!


After the service is started, because the newly created root user has a blank password, you must first set the password. Run the following command:

mysqladmin -u root -p password Enter a new password.

Enter password: Enter the old password.

After the preceding two commands are executed, the new password of the root user is successfully set if Enter password: And the old password entered is correct. To log on to the root user, you must use the new password.
Note: The newly created root user has a blank password. Therefore, when you change the password of the root user for the first time, you can press Enter password: without entering any password.

So far, the decompression and installation of MySQL v5.7.18 have been completed. Therefore, you need to stop the MySQL service that has been started earlier and run the following command:

net stop mysql

Log on to and use MySQL

The installation of the MySQL database has been completed. After the installation is successful, you can log on to the root user and perform data operations, such: create, add, delete, modify, and query tables. The following is a simple process:

Open cmd as an administrator and switch it to the bin directory of the mysql installation directory.

Net start mysql // note: this command is to start mysql service mysql-u root-p // note: this command is used to log on to the root user

Enter password: the password of the previously set root User

After correct logon, you can perform operations on the data, such as adding, deleting, modifying, and querying. Example:

Mysql> show databases; // display all databases. mysql> select statement ...............

If you no longer use the database, log out of the user and stop the service. Run the following command:

mysql> quit;net stop mysql

Delete Database

If you no longer want to use mysql, run the following command:

mysqld --remove

The above section describes how to install Mysql 5.7.18 and how to start the MySQL service. I hope it will help you. If you have any questions, please leave a message, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!

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.